It’s possible to define keyboard shortcuts for your own commands in addition to the predefined Gnome actions. Since metacity is Gnome’s default window manager, you have to edit the metacity keys in your GConf configuration system. The easiest way is doing it with the
gconf-editor (although you can of course edit the xml-definition in
~/.gconf/apps/metacity/ by hand).
So open your
gconf-editor and navigate to the tree ‘/apps/metacity/global_keybindings’. Assign a shortcut to one of the keys
run_command_12, e.g. Alt + F9.
Now you have to tell metacity, which command to run. In the corresponding key
run_command_12 under ‘/apps/metacity/keybinding_commands’ you specify the command that you want to attach to the shortcut.
An Example: We want to start xmms when XF86AudioPlay is pressed, so we have to alter the keys as follows
/apps/metacity/global_keybindings/run_command1 = XF86AudioPlay /apps/metacity/keybinding_commands/command1 = xmms -t
Of course, this only works with the default windows manager metacity. If you use a composition-manager like Compiz or Beryl, your mileage will vary.