Want to set up custom keyboard shortcuts in Ubuntu? xbindkeys let’s you do just that. It’s easy to set up, and should work with any window manager.
Install xbindkeys and its graphical configuration tool using this command:
sudo apt-get install xbindkeys xbindkeys-config
Alternatively, you can click the links below if you are using Ubuntu 7.10 or later:
There’s a bug in xbindkeys that will cause it to crash because there’s no default configuration file. You can work around this problem by running the following command which creates the required file:
Get started creating shortcuts by running xbindkeys-config in a terminal.
Here’s how to create a new keyboard shortcut:
- Click New from the bottom row of buttons.
- Type in a name for the shortcut. This is just an identifier and can be anything you like.
- Click the Get Key button, wait for the capture window to open, and press the shortcut keys you want to use. Be careful that your shortcut does not conflict with any existing ones in GNOME, Metacity, or Compiz. I’ve found Super(windows)+Letter shortcuts work well as long as you watch out for the few that Compiz uses.
- Type the command you want to run with the shortcut in to the Action box. Your command can be anything that runs in the terminal. Here are two examples you may find useful: firefox http://google.com (opens Firefox to a website), gedit myfile.txt (opens a text file). Click the Run Action button to test it out.
- Click Apply to enable your new shortcuts.
- Before you exit xbindkeys-config, click Save & Apply & Exit to save your settings to the default configuration file and exit.
You need to set up xbindkeys to start when you log in. In GNOME, you can add xbindkeys to the list of startup programs in System->Preferences->Sessions.
The first shortcut I set up was Super-P to open my text file of blog post ideas. What keyboard shortcuts do you find useful?