diff --git a/install_files/dinit.d/scripts/yeetmouse-apply.sh b/install_files/dinit.d/scripts/yeetmouse-apply.sh new file mode 100644 index 0000000..2c9de5f --- /dev/null +++ b/install_files/dinit.d/scripts/yeetmouse-apply.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +if [ ! -f /etc/yeetmouse.conf ]; then + exit 0 +fi + +for i in $(seq 1 50); do + if [ -e /sys/module/yeetmouse/parameters/update ]; then + break + fi + sleep 0.1 +done + +if [ ! -e /sys/module/yeetmouse/parameters/update ]; then + echo "YeetMouse parameters did not appear in time" + exit 1 +fi + +chown root:yeetmouse /sys/module/yeetmouse/parameters/* +exec /usr/bin/yeetmousectl apply /etc/yeetmouse.conf diff --git a/install_files/dinit.d/yeetmouse b/install_files/dinit.d/yeetmouse new file mode 100644 index 0000000..1b25059 --- /dev/null +++ b/install_files/dinit.d/yeetmouse @@ -0,0 +1,5 @@ +type = scripted +command = /etc/dinit.d/scripts/yeetmouse-apply.sh +restart = false +logfile = /var/log/yeetmouse.log +after = login.target