Hack:mpd-new-track.sh
From Music Player Daemon Community Wiki
[edit] Code
#!/bin/sh
# Display an OSD when the track is changed
function setNewOSD ()
{
tmp=/tmp/mpd-new-track.sh
currentTrack=`mpc | head -1`
lastTrack=`cat $tmp`
echo "$currentTrack" > $tmp
[ "$currentTrack" != "$lastTrack" ] && mpd-osd.sh&
}
while sleep 1
do
setNewOSD
done
[edit] Usage
Create mpd-osd.sh with code from Hack:mpd-osd.sh (first variant), make it executable and place in same directory with this one or you could yuse full path to script in line 9:
[ "$currentTrack" != "$lastTrack" ] && /path/mpd-osd.sh&
