Keyboard Shortcuts in Gnome
HOWTO: Create Custom Keyboard Shortcuts
The goal of this small HOWTO is to create a custom keyboard shortcut to run a software (like xmms, 3ddesk, ...) or what command line you want (xkill, transset 0.5, ...). Personally i use this trick to launch xkill, different values of transset and also alltray.
A- Using xbindkeys, works for each desktop (KDE, GNOME, XFCE, ...)
1- First install xbindkeys :
sudo apt-get install xbindkeys
2- Install xbindkeys-config, it's a GTK frontend for xbindkeys so it' easy to configure xbindkeys with that.
sudo apt-get install xbindkeys-config
3- Configuration Launch xbindkeys :
Then launch the GUI :
And then enjoy how it's easy to configure shortcuts with this GUI
B- Using metacity (the default GNOME window manager)
In the example i give, i want to start xkill (graphical kill) using "Alt + a" shortcut.
1- Open GConf editor (Applications -> System Tools -> Configuration Editor), go to apps -> metacity -> keybinding_commands, and now choose a command, for my example I choose command_1. Edit command_1 writing xkill in order to run xkill (or every command you want to launch like in a terminal).
2- In the same directory go to global_keybindings. Edit command_1 (or the command you choose in part 1) with the wanted shortcut like that : <Alt>a (to use the windows key just edit the field with Super_L)
3- Another tidbit, if you want to undo a key binding, but you do not know where it is bound, you can search for that binding.
I wanted to use <Control><Alt>h in particular. But that was already bound to Nautilus opening my home directory.
From the metacity configuration window you can Edit > Find.
Type what you are looking for, in my case <Control><Alt>h, check the "Search also in key values" box the click the Find button. The results should point you to the key that contains the search string and you can unbind that combination by replacing it with the string "disbled" (without the quotes).
If you are looking for the name of a key, the tool xev will help you. Just type xev in a terminal then you will see an output for each key you hit. There are some output exemples of xev in the forum thread.