XMMS, Gnome and global hotkeys - setting up keybindings

From Jimbojw.com

Jump to: navigation, search

Using Winamp in Windows, it's pretty easy to set up "global hotkeys" which always control that application - regardless of what else is running. This article describes how to do the same with XMMS and Gnome using global keybindings.

Note: I use Ubuntu - your steps may vary slightly for different distros.

Key layout

On my keyboard, there is a set of buttons above the arrow keys that looks like this:

Insert Home Page Up
Delete End Page Down

Which we will map to these XMMS commands:

Play Pause Previous track
unused Stop Next track

Note: If you want to set up the buttons differently, adjust the global keybindgs (last step) to fit your needs.

Finding the configuration
  1. Open the Gnome configuration editor by executing the command 'gconf-editor' on the command line
  2. Navigate down the left-hand pane to /apps/metacity
Keybinding commands

The first configuration step is to establish the keybinding commands.

  1. Open keybinding_commands under /apps/metacity in the left hand pane.
  2. In the right-hand pane of key/value pairs, enter the values below:
Name Value
command_1 xmms --play
command_2 xmms --pause
command_3 xmms --stop
command_4 xmms --rew
command_5 xmms --fwd
Global keybindings

Lastly, we need to tell Gnome which keys to map to these actions.

  1. Open global_keybindings under /apps/metacity in the left hand pane.
  2. In the right hand pane, enter the values below:
Name Value
run_command_1 <Control><Alt>Insert
run_command_2 <Control><Alt>Home
run_command_3 <Control><Alt>End
run_command_4 <Control><Alt>Prior
run_command_5 <Control><Alt>Next

That's it! A restart of the X server shouldn't be required (but you never know with these things).

As always, I'll be happy to answer any questions. Enjoy!


Got something to say?

Leave a comment
Sorry, comments are disabled.

or, read what others have said ...