Saturday, April 4, 2009

Custom Keyboard Shortcuts in Ubuntu


Ubuntu provides a way to configure keyboard shortcuts through the System >> Preferences >> Keyboard Shortcuts menu. This tool however, is limited to pre-defined actions as listed in the Keyboard Shortcuts window.


You cannot use the Keyboard Shortcuts tool to assign shortcut keys to your own applications, custom scripts or even run standard applications with custom parameters.

The following are steps to configure custom keyboard shortcuts:

(1) Open a terminal and run gconf-editor.

gconf-editor

(2) Expand the tree on the left pane and locate /apps/metacity/keybinding_commands.

(3) On the right pane, select an unused name-value pair, or you may opt to create your own. The screenshot shows 'command_1' was used and the custom command is to launch terminal with 120 columns and 36 rows.


(4) Back to the left pane, locate and select /apps/metacity/global_keybindings. This is right above the previous selection.

(5) On the right pane, locate the run_name corresponding to what you configured in #3 above, i.e. 'run_command_1'. The screenshot below indicates the assignment of key Control-Alt-T.


(6) Close gconf-editor and test your custom keyboard shortcut.

2 comments:

ivanky said...

Hi
I cant thank more
You are just great
Really appreciate this

ivanky said...

Hi
I can't thank more to you.
You re just great.