If you’re like most people, you use your keyboard to navigate your computer. But what if you want to do something specific, like open a file in a certain program? You might have to search through all the shortcuts on your keyboard to find the one you need. Fortunately, there’s an easy way to assign custom shortcut keys on Ubuntu Linux. Here’s how:

  1. Open the System Settings application by clicking the System icon in the upper-left corner of your desktop and selecting System Settings from the menu that appears.
  2. In the System Settings window, click Keyboard under the heading “Input Devices.”
  3. On the Keyboard tab, under “Shortcuts,” click Add Shortcut.
  4. In the Add Shortcut window that opens, type or paste the following command into the text box next to “Command”: cd /home/username/.local/share/apps/terminal
  5. Click OK to close the Add Shortcut window and return to the Keyboard tab of System Settings. Under “Shortcuts,” click Terminal in the list of available shortcuts and press Enter (or double-click Terminal on your desktop). The Terminal window will open with your current directory set as its working directory (i.e., it will show whatever files are in your home directory). ..

First you’ll want to load up gconf-editor by typing it into the Alt+F2 Run dialog.

Once in the application, navigate to the following key. If you are familiar with regedit on Windows, this is very similar.

You’ll notice a bunch of values on the right. These are the available commands that you can create for assigning to shortcut keys in the next step.

Double-click on command_1 and enter in the full path to your script or executable that you are trying to run. (Note that you can use the which command from the shell to find the path most of the time)

 

Now navigate to the key “global_keybindings”, which is directly above the one we were on.

Here you will want to select run_command_1. Enter in the shortcut key in plain text. For instance, for Alt+T, you’ll do T. You could use T or T, or whatever you want to assign to the key.

You can also create custom commands in the keybinding_commands and assign them in the global_keybindings if you want. Just remember that the keybindings will start with run_(name of command).