diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-04-07 14:06:36 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-04-07 14:06:36 +0200 |
commit | 1945a09a7b665a0c6a3980caa64c16c369bd8016 (patch) | |
tree | 9028e5d9aa22bb4da16bfe86ed0db85830cc29b7 | |
parent | 3a2b4265d7c095c39e89887de4d92f0dd7da6c7e (diff) | |
download | pianobar-windows-1945a09a7b665a0c6a3980caa64c16c369bd8016.tar.gz pianobar-windows-1945a09a7b665a0c6a3980caa64c16c369bd8016.tar.bz2 pianobar-windows-1945a09a7b665a0c6a3980caa64c16c369bd8016.zip |
Added remote control example script
-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 |