21/05/2006
Popup of current song playing in xmms
I am a regular user of xmms. I like it because the interface is so simple, because it has tons of plugins for almost anything one can imagine, and because you can control it from the command line.
What I wanted to do was make it able to display the current song on the screen, but only when I want it to. I know there’s an xosd plugin that can display various information on the screen, but it does it every time the song changes. I want that to appear only when I press some key combination.
So I started checking out what I could do. I ended up with gtkdialog, which is a very nice and VERY easy to use programmable interface for displaying custom gtkwindows. It was a matter of 1 minute to create a simple popup with a simple Label and an “OK” button to clear the popup.
Then I needed a program to be able to manipulate and display info about current song in xmms. That was xmmsctrl.
Now time to combine them together with a simple bash script named gtk-xmms-title:
#! /bin/bash
TITLE=`xmmsctrl print "%T (%m of %M)%n"`
export MAIN_DIALOG='
<vbox>
<text>
<label>'$TITLE' </label>
</text>
<hbox>
<button ok></button>
</hbox>
'
gtkdialog --program MAIN_DIALOG
Then I made the script executable and moved it to /usr/bin/. The final touch was to add a keyboard shortcut to my .fluxbox/keys
Mod1 F12 :ExecCommand gtk-xmms-title
Filed by kargig at 13:55 under Linux
No Comments | 3,527 views