Fandom

Music Player Daemon Community Wiki

Hack:mpd-new-track.sh

522pages on
this wiki
Add New Page
Talk0 Share

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&

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.