diff options
-rwxr-xr-x | contrib/remote.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/remote.sh b/contrib/remote.sh new file mode 100755 index 0000000..f266484 --- /dev/null +++ b/contrib/remote.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +echocmd="/bin/echo -n" +ctlfile="$HOME/.config/pianobar/ctl" + +# pianobar running? echo would block otherwise +ps -C 'pianobar' > /dev/null + +if [ $? -ne 0 ]; then + echo 'naughty.notify({title = "pianobar", text = "Not running"})' | awesome-client - + exit 1; +fi + +case "$1" in + pp) + $echocmd p > $ctlfile + ;; + next) + $echocmd n > $ctlfile + ;; + love) + $echocmd + > $ctlfile + ;; + ban) + $echocmd - > $ctlfile + ;; +esac |