summaryrefslogtreecommitdiff
path: root/contrib/eventcmd-examples/multi.sh
blob: 32d62b88c254a668f8208c3f8bfc123e028a3310 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#
# Usage
# =====
# 
# Set
# 
# 	event_command = /path/to/multi.sh
# 
# in pianobar’s config file. Then create the directory
# ~/.config/pianobar/eventcmd.d/, move your eventcmd scripts there and make
# them executable (chmod +x). They will be run in an unspecified order the same
# way the would have been run if pianobar called them directly (i.e. using
# event_command).

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"