stop

Example 3.4. /home/cweiske/scripts/stop

#!/bin/sh
kaffeine=`dcop | grep kaffeine -c`
if [ $kaffeine = '1' ]
then
    dcop kaffeine Kaffeine stop
elif [ `pgrep tvtime` ]
then
    tvtime-command TOGGLE_PAUSE
tvtime-command TOGGLE_MUTE
else
    xmms -s
fi