From 1945a09a7b665a0c6a3980caa64c16c369bd8016 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 7 Apr 2009 14:06:36 +0200 Subject: Added remote control example script --- contrib/remote.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 contrib/remote.sh 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 -- cgit v1.2.3