Controlling Amarok 2 with LIRC

I picked up a Media Center remote while I was in the US and wanted to set up LIRC to control Amarok.

It’s fairly simple since all you need to do is map the LIRC controls to qdbus commands and use a bash script to control volume and position seeking.

First, if you haven’t already, you need to install LIRC. On Debian/Kubuntu you can install it with apt-get install lirc.

Once you’ve done that, make sure you’re using the correct driver by testing input with ‘irw‘. The output should look like this (the driver I’m using is mceusb – yours might be different):

don@desktop:~$ irw
000000037ff07be9 00 Play mceusb

If you don’t get any output from irw you need to take a step back and get the correct driver working for your remote first. I had to reboot for the driver to work.

After you have installed the driver, save lirc-amarok to $HOME/.lirc/amarok, open it in your favourite text editor and replace mceusb with the driver you are using (irw output will show the driver you are using):

Then, save lirc-amarok.sh to $HOME/bin/lirc-amarok.sh and chmod +x $HOME/bin/lirc-amarok.sh to make it executable.

The lirc-amarok.sh script isn’t loaded by LIRC automatically so you need to run it yourself. Either when starting your desktop or by editing your Amarok menu entry to run “lirc-amarok.sh && amarok %U” – which will load it only when you open Amarok.

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.