Current track

To display the current track in the status bar, your can use your favorite music client along with awesome-client.

The following script filters the title from information given by the cmus player. If you use another player, you should change the first title= line.


 * 1) !/bin/sh

while true; do       if [ "$(cmus-remote -Q)" == "" ] then echo -e "nowplaying.text=\"\"" | /usr/bin/awesome-client; sleep 5 continue else

playing=$(cmus-remote -Q | grep 'playing');

status="playing" if [ "$playing" == "" ] then status="paused" fi

title=$(cmus-remote -Q | sed -n 's/tag title \(.*\)/\1/p'); title=$(echo $title | sed 's/\"/\\\"/g'); # escape title echo -e "nowplaying.text=\"Now $status: $title\"" | /usr/bin/awesome-client; sleep 1; fi done

Now you should add the curtrack widget to your status bar.

-- Create a widget for current track nowplaying = widget({ type = "textbox", align = "right"})

...   mywibox[s].widgets = { {           mylauncher, mytaglist[s], mypromptbox[s], layout = awful.widget.layout.horizontal.leftright },       mylayoutbox[s], mytextclock, separator, nowplaying,                        <- s == 1 and mysystray or nil, mytasklist[s], layout = awful.widget.layout.horizontal.rightleft }