Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how do i make a command that executes a program when a custom hotkey is pressed? Are there any good tutorials on how the command / terminal system works in ubuntu? I want to know how (using the terminal) I can run libreoffice or any other program for that matter. Thank you very much for any info you can assist me with. lol sorry if these are such noob questions.

share|improve this question

On the Keyboard settings windows (super+A, then "keyboard"), click the "Shortcuts" tab, and on the list on the left will be an option for "Custom Shortcuts".

Press the + button, then give your shortcut a name and the program you want run.

It will default to "Disabled", but click on that and then press your keyboard combination you want, and it will become associated with your program.

share|improve this answer

There are two ways you can accomplish this task: The first way it GUI based, using:

Open Applications > System Tools > Configuration Editor
Then apps > metacity > global_keybindings in the tree view

This should enable you to modify your key values as long as you stay within the acceptable syntax.

The alternate way to edit your keybindings is by directly editing the gconf.xml files:

$HOME/.gconf/apps/metacity/gloabl-keybindings/%gconf.xml $HOME/.gconf/apps/metacity/keybinding_commands/%gconf.xml

You can find more information at

share|improve this answer

I admit it can get a bit thick to get through, but check out man xmodmap for a way to define any key binding.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.