summaryrefslogtreecommitdiff
path: root/app-laptop/i8kutils/files/i8k.init-r1
diff options
context:
space:
mode:
Diffstat (limited to 'app-laptop/i8kutils/files/i8k.init-r1')
-rw-r--r--app-laptop/i8kutils/files/i8k.init-r150
1 files changed, 50 insertions, 0 deletions
diff --git a/app-laptop/i8kutils/files/i8k.init-r1 b/app-laptop/i8kutils/files/i8k.init-r1
new file mode 100644
index 000000000000..1e1cb7ca0c94
--- /dev/null
+++ b/app-laptop/i8kutils/files/i8k.init-r1
@@ -0,0 +1,50 @@
+#!/sbin/openrc-run
+
+depend() {
+ after alsasound
+ after modules
+}
+
+checkconfig() {
+ if [ ! -e /proc/i8k ] ; then
+ eerror "The i8k driver is not installed"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ if [ -n "$VOLUME_UP$VOLUME_DOWN$VOLUME_MUTE" ] ; then
+ ebegin "Starting i8kbuttons"
+ start-stop-daemon --start --quiet --pidfile /var/run/i8kbuttons.pid \
+ --make-pidfile --exec /usr/bin/i8kbuttons --background \
+ -- ${VOLUME_UP:+-u "${VOLUME_UP}"} \
+ ${VOLUME_DOWN:+-d "$VOLUME_DOWN"} \
+ ${VOLUME_MUTE:+-m "$VOLUME_MUTE"} \
+ ${BUTTON_REPEAT:+-r "$BUTTON_REPEAT"}
+ eend $?
+ fi
+ if [ ! -n "$NOMON" ]; then
+ ebegin "Starting i8kmon"
+ start-stop-daemon --start -b --quiet \
+ --pidfile /var/run/i8kmon.pid \
+ --make-pidfile \
+ --exec /usr/bin/i8kmon --background \
+ --name "tclsh /usr/bin/i8kmon" \
+ -- -d ${NOAUTO:+-na} ${TIMEOUT:+-t $TIMEOUT}
+ eend $?
+ fi
+}
+
+stop() {
+ if [ -n "$VOLUME_UP$VOLUME_DOWN$VOLUME_MUTE" ] ; then
+ ebegin "Stopping i8kbuttons"
+ start-stop-daemon --stop --quiet --pidfile /var/run/i8kbuttons.pid
+ eend $?
+ fi
+ if [ ! -n "$NOMON" ]; then
+ ebegin "Stopping i8kmon"
+ start-stop-daemon --stop --quiet --pidfile /var/run/i8kmon.pid
+ eend $?
+ fi
+}