Saturday, 30 January 2010

How to set keyboard shortcuts in Ubuntu

From now on, I will be posting some tips and tricks which I think are cool to know. Here is the first one.

If you use your computer for more than 4 hours a day, you probably have a few things you do regularly. I for instance, open the terminal quite frequently, and it is a pain to move my hands from the keyboard, take it to the mouse, then select Applications tab and then select the Accessories menu and then go down by about 10 items to open the terminal. I am not being lazy, but I think there should be a better way. We can use keyboard shortcuts to avoid that much trouble.

The following is for users who have Metacity as the window manager. Which is what most people might be using.

To do that,

1. Open your terminal the normal way :P
2. Type in: gconf-editor
3. A window opens up, select apps->metacity->keybinding_commands
4. There would be several rows with the fields of the form command_1, command_2 and so on. Select anyone of them, and edit their value. Write the command you want to execute when your type in the keyboard shortcut. In my case it was: gnome-terminal.



5. Now go to apps->metacity->global_keybindings
6. If you selected command_1, then select the row with the first column value as 'run_command_1'.
7. Edit the value, and set it to the shortcut you want. For example, if you want Control + e, you can write: <Control>e



8. You can also write something like <Shift><Alt>p etc.
9. Voila!

It works..

2 comments:

තමීර | Thameera said...

I do the same thing using Ubuntu Tweak. My favourite is Ctrl+Alt+Space to open up the System Monitor. :)

Gaurav Menghani said...

Ohh Nice.. Never used Ubuntu Tweak. Will check it out. :)