So I was playing around with my conky config and I thought it’d be cool to be able to see my “now playing” song from it. Conky has some built in bits for that kind of thing in mpd but that’s no use to me since I use rhythmbox to listen to my music. A bit of googling around came up with some hits on using dbus-send to find the info [1,2] but the output was a little more raw than I was hoping for. While I was have a brief look through the rhythmbox manpage I noticed down the bottom of the page:
SEE ALSO
rhythmbox-client(1).
Aaah, how handy ๐ So issuing a rhythmbox-client --print-playing
gives me this (the last line of the screenshot):
rhythmbox-client
can also handly play/pause, stop, next, previous, skip, add songs to the queue and other stuff to rhythmbox, all from the command line. In my .conkyrc
I put the following line to give the “Now Playing” output:
${color #5b6dad}Now Playing: ${color}${exec /usr/bin/rhythmbox-client --print-playing}
Thanks that was useful.
I found that if I used your line then rhythmbox would open if it wasn’t already, which I didn’t really want. Mine looks like this now. This gives the album title on a line below too:
Now Playing:
${exec /usr/bin/rhythmbox-client –no-start –no-present –print-playing-format “%ta – %tt”}
${exec /usr/bin/rhythmbox-client –no-start –no-present –print-playing-format “%at”}
Ah nice one Adam. I did notice that too but since I always have it running, I didn’t bother doing anything about it. Thanks for the tip!
Thats the reason why I never started working with Linux. Itยดs takes to long time, to install every software from the command line, put my wlan to work and other stuff.. XP runs for me much faster, in the way for installing something, drivers, etc.
Jeje maybe Linux is just not for you.
The conversation here is on how to have the Rhythmbox player information show on the desktop. There is just no way to do something like that on a Windows system. Yes, it takes some command line magic to make this work. It IS possible to do this with Linux, it is NOT possible to do it with Windows.
Maybe you have not installed Linux recently. The average person can now install Linux and have more eye candy than windows, without ever touching the command line. If you want more apps, it is even easier than in Windows, just pick off a list what you want and it is installed.
Of course if you know the command line you can always do something like
apt-get install flashplayer-nonfree rhythmbox openssh-server x11vnc
and in one shot install all the software that does not come with a default install.
I have a tight space for my conky so I just want the first 22 bytes of the song title followed by ellipses. Also I check first to see if rhythmbox is active. Cheers.
${if_running rhythmbox}${color #A7D7BB}${exec /usr/bin/rhythmbox-client –no-start –no-present –print-playing|cut -b -22}…$endif
Thanks for your tips!
Thanks for your tips but I don’t know if I will use them right away. This stuff seems to be way over my head! But we all appreciate you sharing freely what you know.
Thanks for share this,love linux,it’s more powerful than win
Thanks ๐
Anyway to check if rhythmbox is running? E.g. I want to hide “now playing” when rhythmbox is closed.
Also thanks for sharing this.
You can also use this script
#!/bin/bash
playing=`rhythmbox-client –no-start –print-playing`
if [ -n “$playing” ]
then
echo $playing
else
echo “Not playing”
fi
and use execi to execute that script. It doesn’t really add functionality, it basically just gives output without having to have rhythmbox on. It looks prettier if you’re not the kind of person who always has rhythmbox on.