Howto: Use GNOME media keys with Amarok 2.0

Posted by Keith Gable (ZiggyTheHamster) Mon, 12 Jan 2009 05:45:00 GMT

Actually, this will work for anyone, regardless of desktop environment. GNOME users are the most affected, because GNOME doesn’t send keys to Amarok for it to process.

Anyway, this is really simple. First you need to know what your media keys are. I have a Das Keyboard Professional so it lacks media keys; I use Meta and the numberpad to control my media stuff.

First, install xbindkeys. You probably already have it. Next, turn off Caps Lock, Numlock, and Scroll Lock, then use xbindkeys --key and press the key or key combination you want. You will likely get a name for the key like XFMediaPlayPause. Failing that, you’ll get a code. Either will work. Copy the code or better yet the name.

Edit ~/.xbindkeys. Make yours like this:

"amarok --play-pause"
  Mod4 + KP_Multiply

"amarok --next"
  Mod4 + KP_Add

"amarok --previous"
  Mod4 + KP_Subtract

First line isn’t indented and is the command to execute. Second is indented two spaces and the code you got previously.

Add xbindkeys to ~/.xinitrc (you may need to create it, chmod +x it, and put #!/bin/bash at the beginning of the file).

Hopefully that helps!

Comments

Leave a response

Comments