If you’re like me, you like to open your programs and run with keyboard shortcuts rather than clicking on an icon in the toolbar. It’s much faster and keeps your desktop & toolbars less cluttered. This method can also get your multimedia buttons on your laptop/keyboard working in gnome if the music player you’re using has commands for play, pause, etc. To find out, type the name of your music player and then –help, e.g. “amarok –help” (EDIT: Those are two dashes, not one big dash. WordPress automatically converts two dashes into that other dash character, which won’t work.)
First open a terminal and run gconf-editor. Then browse to apps/metacity/keybinding_commands. Here, you can enter up to 12 commands that will correspond to 12 different keyboard shortcuts that you will define in the next step. For example, for command_1 I have “gnome-terminal” and for command_2 I have “firefox” which opens my firefox browser.
Next we need to define the keyboard shortcuts that are used to activate the commands we set up in the previous step. In gconf-editor, browse to apps/metacity/global_keybindings and enter the keyboard shortcuts you would like to correspond to the commands that you entered previously. For example, for run_command_1 I have “<Mod4>t” which runs command_1 which is gnome-terminal, therefore opening a Gnome terminal window. Continue through the rest of the commands you defined earlier.
In case you were wondering, “<Mod4>” is the name of my start menu button on my keyboard. I prefer to use it for keyboard shortcuts since it’s useless for anything else. To use your start button like I do for keyboard shortcuts, go to System, Preferences, Keyboard, then go to the Layout Options tab, then go to the Alt/Win key behavior section, and make sure “Super is mapped to the Win-keys (default)” is selected. Now you should be able to use the “<Mod4>” name for your start button. If not, you can still use ctrl + alt + or similar. Just follow the syntax of the other shortcuts. For example, if you wanted Ctrl+Alt+f to start firefox, you would enter <ctrl><alt>f in the run_command_x box that corresponds to the command_x box that you entered “firefox” into in the last step.
If you don’t know the names of your multimedia/shortcut buttons you can open up System, Preferences, Keyboard Shortcuts, setting them to something to find out their names, disabling them again, and typing the names you found out in gconf-editor.
December 21, 2006 at 12:07 am
Alex, Since you’re using ubuntu had you tried setting up the shortcuts through System/Preferences/Keyboard Shortcuts?
I’ve had problems with using this method but I’d like to try and use your method. Could you break down the process for a newbie?
I’ve reached the gconf-editor and navigated to the keys you describe but when I click on “command_1″ or any of the commands. I can only change the value. Is that what you see?
When I use the System/Preferences/Keyboard Shortcuts method, I can assign the win+f key to open my web browser but when I click on it, nothing happens.
I have two win mods that do work win+d (desktop) and (win+r) terminal but win+f (firefox) and win+e (file explorer) won’t go.
Thanks for any advice you can throw my way!
July 29, 2007 at 10:59 am
Mouse
yeah thats what I ment, i didnt remember the spelling but i did remember the meaning of the Mouse
November 28, 2007 at 8:58 pm
Hi.
Good design, who make it?
July 28, 2008 at 11:31 pm
[...] Create custom keyboard shortcuts in ubuntu (also for multimedia keys) « Alex S. more info on creating shortcuts for the keyboard in Ubuntu [...]
March 31, 2009 at 12:40 pm
Nice Hint,
used it to get my Amarok playing along nicely with Gnome and Compiz. (Ubuntu 8.1). Just had to disable the Media-Keys in the Keyboardshortcuts (Tastenkombinationen) and then configure my new shortcuts with the CompizConfig tool.
June 21, 2009 at 5:13 am
Great!
That’s exaclty what i’ve searched for