summaryrefslogtreecommitdiff
path: root/contrib/eventcmd-examples/multi.sh
blob: 4aa66a8837660d6d166e0dbc09ca2b819e1de784 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
#
# Executes all scripts located in ~/.config/pianobar/eventcmd.d/ as if they
# were called by pianobar directly

STDIN=`mktemp ${TMPDIR:-/tmp}/pianobar.XXXXXX`
cat >> $STDIN

for F in ~/.config/pianobar/eventcmd.d/*; do
	if [ -x "$F" ]; then
		"$F" $@ < "$STDIN"
	fi
done

rm "$STDIN"