File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171 @cp udev/$(PROGN ) .rules $(DESTDIR ) /etc/udev/rules.d
7272 @test -s /usr/bin/systemd-run && \
7373 install -m 755 -d $(DESTDIR )$(SYSTEMDDIR ) /system && \
74- cp systemd/$(PROGN ) -reboot.service $(DESTDIR )$(SYSTEMDDIR ) /system
74+ cp systemd/$(PROGN ) -reboot.service $(DESTDIR )$(SYSTEMDDIR ) /system && \
75+ cp systemd/$(PROGN ) -numlock-color.service $(DESTDIR )$(SYSTEMDDIR ) /system
7576
7677install-lib : lib
7778 @install -m 755 -d $(libdir )
@@ -103,6 +104,7 @@ uninstall:
103104 @test -s /usr/bin/systemd-run && \
104105 systemctl disable $(PROGN ) -reboot && \
105106 rm $(SYSTEMDDIR ) /system/$(PROGN ) -reboot.service && \
107+ rm $(SYSTEMDDIR ) /system/$(PROGN ) -numlock-color.service && \
106108 systemctl daemon-reload && \
107109 rm -R /etc/$(PROGN )
108110
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =Update RGB for Num-Lock state
3+
4+ [Service]
5+ Restart =always
6+ Environment =NUM_ON_COLOR =FF0000
7+ Environment =NUM_OFF_COLOR =00FFFF
8+
9+ ExecStart =/bin/bash -c ' \
10+ LAST_STATE=""; \
11+ while true; do \
12+ STATE=$(cat /sys/class/leds/*::numlock/brightness | head -n1 ) ; \
13+ if [ "$STATE" != "$LAST_STATE" ]; then \
14+ if [ "$STATE" -eq 1 ]; then \
15+ g810-led -k numlock "$NUM_ON_COLOR" ; \
16+ else \
17+ g810-led -k numlock "$NUM_OFF_COLOR" ; \
18+ fi; \
19+ LAST_STATE="$STATE"; \
20+ fi; \
21+ sleep 0.2; \
22+ done;'
23+
24+ [Install]
25+ WantedBy =multi-user.target
You can’t perform that action at this time.
0 commit comments