4 dest=org.freedesktop.Notifications
5 opath=/org/freedesktop/Notifications
7 idfile=~/tmp/mpc-notify.id
11 if [ -e $idfile ]; then
12 replaces_id=`cat $idfile`
14 echo $(expr "$(gdbus call --session \
15 --dest $dest --object-path $opath --method $meth \
16 mpc $replaces_id audio-volume-high "${1:-$out1}" "${2:-$out2}" '[]' \
17 '{"urgency": <byte 0>}' 3000)" : '(uint32 \([0-9]*\),)') > $idfile
21 #TODO test if not playing for some commands
22 #if mpc -f '' status | awk 'NR==2' | grep -v '^\[playing\]'; then
25 out1=`$mpc -f %artist% current`
26 out2="`$mpc -f %title% current`\n`mpc -f %album% current`";;
27 status) out1=`$mpc current`
28 out2=`$mpc -f '%album% (%date%)' status`;;
31 if [ -z "$out1$out2" ]; then
38 -d|--daemon|idle|idleloop)
40 $mpc idleloop player | while read -r x; do
42 notify "$out1" "$out2"
45 *) getoutput $cmd || return 1;;
47 notify "$out1" "$out2"