This wiki will shut down!

Please note that this wiki will be made read-only and eventually be taken offline.

A replacement is being discussed at We'd be happy to have more input for that discussion and volunteers who help us migrate the content of this wiki to its replacement.

MPD information with mpdcron

From awesome
Jump to: navigation, search

You'll only need mpdcron and (of course) a running MPD-server.

Place into your ~/.mpdcron/mpdcron.conf (to mpd section):

events = player

Of course you can add more events if you want.

Your ~/.mpdcron/hooks/player:

echo "mpdcron({state=\"$MPD_STATUS_STATE\", \
   artist=\"$MPD_SONG_TAG_ARTIST\", title=\"$MPD_SONG_TAG_TITLE\"})" | awesome-client

Create a textbox widget named mpdtextbox and put into your awesome's rc.lua:

function mpdcron (mpdinf)
   local mpdtext = ""
   if (mpdinf.state=="play") then
       mpdtext = mpdinf.artist .. " - " .. mpdinf.title
   elseif (mpdinf.state=="pause") then
       mpdtext = " [[[ " .. mpdinf.artist .. " - " .. mpdinf.title .. " ]]]"
       mpdtext = " [ leállítva ] "
   mpdtextbox.text = awful.util.escape(mpdtext)

Run mpdcron and enjoy!