summaryrefslogtreecommitdiff
path: root/contrib/eventcmd-examples/multi.sh
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-12-09 13:25:59 +0100
committerLars-Dominik Braun <lars@6xq.net>2011-12-09 13:25:59 +0100
commit4ba19ba18deb919646cc0c120e3b0d90e53c2667 (patch)
treeeab6d356572db40d2c5f1abab553bd3d711963b2 /contrib/eventcmd-examples/multi.sh
parent3dd05b6727a410c77420c7f366ed6a76fde601da (diff)
downloadpianobar-windows-4ba19ba18deb919646cc0c120e3b0d90e53c2667.tar.gz
pianobar-windows-4ba19ba18deb919646cc0c120e3b0d90e53c2667.tar.bz2
pianobar-windows-4ba19ba18deb919646cc0c120e3b0d90e53c2667.zip
Add multi.sh eventcmd
Suggested by #191, slightly improved.
Diffstat (limited to 'contrib/eventcmd-examples/multi.sh')
-rwxr-xr-xcontrib/eventcmd-examples/multi.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/eventcmd-examples/multi.sh b/contrib/eventcmd-examples/multi.sh
new file mode 100755
index 0000000..a6eb016
--- /dev/null
+++ b/contrib/eventcmd-examples/multi.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# Executes all scripts located in ~/.config/pianobar/eventcmd.d/ as if they
+# were called by pianobar directly
+
+STDIN=`mktemp`
+cat >> $STDIN
+
+for F in ~/.config/pianobar/eventcmd.d/*; do
+ if [ -x "$F" ]; then
+ "$F" $@ < "$STDIN"
+ fi
+done
+
+rm "$STDIN"
+