3 # play the sound files specified.
5 # locates a process given a search pattern to match in the process list.
6 # copied from functions.h in yeti to avoid intermixing dependencies.
8 mkdir -p "$TEMPORARIES_DIR"
9 PID_DUMP="$(mktemp "$TEMPORARIES_DIR/zz_pidlist.XXXXXX")"
10 appropriate_pattern='s/^[-a-zA-Z_0-9][-a-zA-Z_0-9]* *\([0-9][0-9]*\).*$/\1/p'
11 # pattern to use for peeling off the process numbers.
13 # flags to pass to ps if any special ones are needed.
14 if [ "$OS" = "Windows_NT" ]; then
15 # on win32, there is some weirdness to support msys.
16 appropriate_pattern='s/^[ ]*\([0-9][0-9]*\).*$/\1/p'
19 /bin/ps $extra_flags wuax >$PID_DUMP
20 # remove the first line of the file, search for the pattern the
21 # user wants to find, and just pluck the process ids out of the
23 PIDS_SOUGHT=$(cat $PID_DUMP \
26 | sed -n -e "$appropriate_pattern")
27 if [ ! -z "$PIDS_SOUGHT" ]; then echo "$PIDS_SOUGHT"; fi
32 #echo no sound file specified.
36 export PLAYCMD=/usr/bin/play
37 if [ ! -f "$PLAYCMD" ]; then
41 if [ ! -z "$(psfind pulseaudio)" ]; then
42 # we see artsd running...
44 elif [ ! -z "$(psfind artsd)" ]; then
45 # we see artsd running...
47 elif [ ! -z "$(psfind esd)" ]; then
48 # we see esd running...
50 elif [ ! -z "$WINDIR" ]; then
51 # kludge for win32; we provide our own sound player.
52 PLAYCMD=$CLAM_BIN/playsound
55 # play the sounds individually; playsound can handle multiple files, but
56 # "play" doesn't want to on some systems.
58 ($PLAYCMD $i &>/dev/null &);