diff --git a/BUILD.md b/BUILD.md index a431bbc..b8e3496 100644 --- a/BUILD.md +++ b/BUILD.md @@ -12,11 +12,13 @@ First copy the binary and the service files to their system directories: * Upstart (Ubuntu, prior to 15.04): `sudo cp -R bin/* /usr/bin && sudo cp service/upstart/ckb-daemon.conf /etc/init` * Systemd (Ubuntu 15.04 and later): `sudo cp -R bin/* /usr/bin && sudo cp service/systemd/ckb-daemon.service /usr/lib/systemd/system` +* OpenRC: `sudo cp -R bin/* /usr/bin && sudo cp service/openrc/ckb-daemon /etc/init.d/` To launch the driver and enable it at start-up: * Upstart: `sudo service ckb-daemon start` * Systemd: `sudo systemctl start ckb-daemon && sudo systemctl enable ckb-daemon` +* OpenRC: `sudo rc-service ckb-daemon start && sudo rc-update add ckb-daemon default` Open the `bin` directory and double-click on `ckb` to launch the user interface. If you want to run it at login, add `ckb --background` to your Startup Applications. diff --git a/README.md b/README.md index 10de341..b23216d 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,12 @@ sudo rm -f /usr/lib/systemd/system/ckb-daemon.service sudo service ckb-daemon stop sudo rm -f /etc/init/ckb-daemon.conf ``` +* If you have OpenRC: +``` +sudo rc-service ckb-daemon stop +sudo rc-update del ckb-daemon default +sudo rm -f /etc/init.d/ckb-daemon +``` * If you're not sure, re-run the `quickinstall` script and proceed to the service installation. The script will say `System service: Upstart detected` or `System service: systemd detected` Afterward, remove the applications and related files: diff --git a/service/openrc/ckb-daemon b/service/openrc/ckb-daemon new file mode 100755 index 0000000..272e0f0 --- /dev/null +++ b/service/openrc/ckb-daemon @@ -0,0 +1,17 @@ +#!/usr/bin/openrc-run +description="Daemon for the opensource ckb driver for corsair keyboards and mice" + +daemon_ckb="/usr/bin/ckb-daemon" +PIDFILE="/dev/input/ckb0/pid" + +start() { + ebegin "Starting ckb" + start-stop-daemon --start --quiet --exec ${daemon_ckb} --background + eend $? +} + +stop() { + ebegin "Stopping ckb" + start-stop-daemon --stop --quiet --exec ${daemon_ckb} --pidfile $PIDFILE + eend $? +}