Recent changes Random page
GAMING
Technology
 
Gaming
Entertainment
Science Fiction
Biggest wikis
Hobbies
Music
See more...

Hack:mpd-osd.sh

From Music Player Daemon Community Wiki

Jump to: navigation, search
 
#!/bin/sh
# Display an OSD of the current track
COLOR="#495D94"
osd ()
{
  title=`mpc | head -1 | sed 's/^volume: [0-9]*%.*/(nothing)/'`
  position=`mpc | head -2 | tail -1 | sed 's/.*\(([0-9]*%)\)/\1/'`
   "$title" == "(nothing)"  && exit || echo "Playing:\n$title $position "
}
pid=`ps ax | grep osd_cat | sed '/grep/d' | awk '{print $1}'`
[ "$pid" ] && kill $pid
echo -e `osd` | \
 osd_cat -f '-bitstream-charter-bold-r-*-*-*-250-*-*-*-*-*-*' \
 -p bottom -o 15 -l 3 -A right -c "$COLOR" -s 1 -d 4
Rate this article:
Share this article: