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!

Fix: Dolphin hijacks the GNOME Places menu

Posted by Keith Gable (ZiggyTheHamster) Thu, 08 Jan 2009 06:16:00 GMT

I had a problem where items in the GNOME Places menu were opening in Dolphin (and weren’t working). Somehow Dolphin hijacked the file:// protocol. The fix is simple though is something I just found by looking around in GConf Editor.

Why would I have Dolphin installed in GNOME you ask? Amarok 2.0 needs it. By the way it’s nice.

Do this as your normal user (not root):

gconftool-2 --set --type=string /desktop/gnome/url-handlers/file/command 'nautilus "%s"'
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/file/enabled true
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/file/need-terminal false

Hopefully other users find this through Google, because having the GNOME Panel’s Places menu launch Dolphin instead of Nautilus sucks, and this fixes it! :) (that’s a paragraph of keywords, folks)

(If you use a different file manager, replace the command as needed)