summaryrefslogtreecommitdiff
path: root/contrib/remote.sh
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-04-07 14:06:36 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-04-07 14:06:36 +0200
commit1945a09a7b665a0c6a3980caa64c16c369bd8016 (patch)
tree9028e5d9aa22bb4da16bfe86ed0db85830cc29b7 /contrib/remote.sh
parent3a2b4265d7c095c39e89887de4d92f0dd7da6c7e (diff)
downloadpianobar-1945a09a7b665a0c6a3980caa64c16c369bd8016.tar.gz
pianobar-1945a09a7b665a0c6a3980caa64c16c369bd8016.tar.bz2
pianobar-1945a09a7b665a0c6a3980caa64c16c369bd8016.zip
Added remote control example script
Diffstat (limited to 'contrib/remote.sh')
-rwxr-xr-xcontrib/remote.sh27
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