Wikia

Music Player Daemon Community Wiki

Hack:mpd-new-track.sh

525pages on
this wiki
Talk0

Code Edit

#!/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

Usage Edit

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&

Around Wikia's network

Random Wiki