mirror of
https://github.com/MatMoul/g810-led.git
synced 2025-04-04 23:31:48 +00:00
Added systemd sleep/resume hack, udev groups, and makefile updates.
This commit is contained in:
parent
1b480ae4c2
commit
580c8494c5
7
makefile
7
makefile
@ -9,6 +9,7 @@ else
|
|||||||
LDFLAGS=-lhidapi-hidraw
|
LDFLAGS=-lhidapi-hidraw
|
||||||
endif
|
endif
|
||||||
SYSTEMDDIR?=/usr/lib/systemd
|
SYSTEMDDIR?=/usr/lib/systemd
|
||||||
|
SYSTEMD_SLEEP_DIR?=/lib/systemd/system-sleep
|
||||||
|
|
||||||
prefix?=$(DESTDIR)/usr
|
prefix?=$(DESTDIR)/usr
|
||||||
libdir?=$(prefix)/lib
|
libdir?=$(prefix)/lib
|
||||||
@ -18,7 +19,7 @@ includedir?=$(prefix)/include
|
|||||||
PROGN=g810-led
|
PROGN=g810-led
|
||||||
MAJOR=0
|
MAJOR=0
|
||||||
MINOR=2
|
MINOR=2
|
||||||
MICRO=7
|
MICRO=8
|
||||||
|
|
||||||
CFLAGS+=-DVERSION=\"$(MAJOR).$(MINOR).$(MICRO)\"
|
CFLAGS+=-DVERSION=\"$(MAJOR).$(MINOR).$(MICRO)\"
|
||||||
APPSRCS=src/main.cpp src/helpers/*.cpp src/helpers/*.h
|
APPSRCS=src/main.cpp src/helpers/*.cpp src/helpers/*.h
|
||||||
@ -89,6 +90,9 @@ install: setup
|
|||||||
@test -s /usr/bin/systemd-run && \
|
@test -s /usr/bin/systemd-run && \
|
||||||
systemctl daemon-reload && \
|
systemctl daemon-reload && \
|
||||||
systemctl enable $(PROGN)-reboot
|
systemctl enable $(PROGN)-reboot
|
||||||
|
@test -d $(SYSTEMD_SLEEP) && \
|
||||||
|
install -m 755 -d $(SYSTEMD_SLEEP_DIR) && \
|
||||||
|
install -m 755 systemd/lib/systemd/system-sleep/g810-led.systemd.system-sleep $(SYSTEMD_SLEEP_DIR)/
|
||||||
|
|
||||||
uninstall-lib:
|
uninstall-lib:
|
||||||
@rm -f $(libdir)/lib$(PROGN).so*
|
@rm -f $(libdir)/lib$(PROGN).so*
|
||||||
@ -103,6 +107,7 @@ uninstall:
|
|||||||
systemctl daemon-reload && \
|
systemctl daemon-reload && \
|
||||||
rm -R /etc/$(PROGN)
|
rm -R /etc/$(PROGN)
|
||||||
|
|
||||||
|
@rm $(SYSTEMD_SLEEP_DIR)/g810-led.systemd.system-sleep
|
||||||
@rm /usr/bin/g213-led
|
@rm /usr/bin/g213-led
|
||||||
@rm /usr/bin/g410-led
|
@rm /usr/bin/g410-led
|
||||||
@rm /usr/bin/g413-led
|
@rm /usr/bin/g413-led
|
||||||
|
13
systemd/lib/systemd/system-sleep/g810-led.systemd.system-sleep
Executable file
13
systemd/lib/systemd/system-sleep/g810-led.systemd.system-sleep
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
post)
|
||||||
|
# For now, restart used due to oneshot startup
|
||||||
|
systemctl restart g810-led
|
||||||
|
;;
|
||||||
|
pre)
|
||||||
|
# For now, restart used due to oneshot startup
|
||||||
|
systemctl restart g810-led-reboot
|
||||||
|
;;
|
||||||
|
esac
|
@ -1,10 +1,10 @@
|
|||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c336", MODE="666" RUN+="/usr/bin/g213-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c336", GROUP="input" RUN+="/usr/bin/g213-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c330", MODE="666" RUN+="/usr/bin/g410-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c330", GROUP="input" RUN+="/usr/bin/g410-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33a", MODE="666" RUN+="/usr/bin/g413-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33a", GROUP="input" RUN+="/usr/bin/g413-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c333", MODE="666" RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c333", GROUP="input" RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c338", MODE="666" RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c338", GROUP="input" RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c331", MODE="666" RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c331", GROUP="input" RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c337", MODE="666" RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c337", GROUP="input" RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c32b", MODE="666" RUN+="/usr/bin/g910-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c32b", GROUP="input" RUN+="/usr/bin/g910-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c335", MODE="666" RUN+="/usr/bin/g910-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c335", GROUP="input" RUN+="/usr/bin/g910-led -p /etc/g810-led/profile"
|
||||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c339", MODE="666" RUN+="/usr/bin/gpro-led -p /etc/g810-led/profile"
|
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c339", GROUP="input" RUN+="/usr/bin/gpro-led -p /etc/g810-led/profile"
|
||||||
|
Loading…
Reference in New Issue
Block a user