Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- tmpfile=/tmp/g13.sh.tmp
- dlpbm="/usr/local/misc/wtf.lpbm"
- drgb="0 50 235"
- dmod="15"
- binder="/etc/conf.d/g13-binder.conf"
- . /etc/conf.d/g13.conf
- function start()
- {
- chmod 0777 /dev/input/uinput >/dev/null 2>&1
- /usr/local/bin/g13 >/dev/null 2>&1 &
- chmod 0777 /tmp/g13-0 >/dev/null 2>&1
- sleep 1.5
- echo "rgb ${drgb}" >/tmp/g13-0
- echo "mod ${dmod}" >/tmp/g13-0
- sleep 1
- cat ${dlpbm} >/tmp/g13-0
- sleep 1
- cat ${binder} |grep -v '#' |sed '/^$/d' >${tmpfile}
- while read -r line
- do
- echo "${line}" >/tmp/g13-0
- sleep 0.1
- done <${tmpfile}
- chmod 0777 /tmp/g13-0
- }
- function stop()
- {
- killall g13
- }
- case "$1" in
- --start) start;;
- --stop) stop;;
- --restart) stop; sleep 0.5; start;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement