If you find yourself opening the terminal, launching a specific application, or running a complex bash script multiple times a day, you can save massive amounts of time by assigning these actions to a custom keyboard shortcut. Ubuntu makes it incredibly easy to bind any command to a combination of keystrokes.
How to Assign a Custom Shortcut
- Open the Settings app from your Ubuntu application menu.
- In the left-hand sidebar, scroll down and click on Keyboard.
- Scroll to the very bottom of the Keyboard settings page and click on View and Customise Shortcuts.
- A new window will appear listing all default system shortcuts. Scroll to the very bottom of this list and click on Custom Shortcuts.
- Click the Add Shortcut button (or the + icon).
Configuring the Command
A small dialogue box will appear asking for three pieces of information:
- Name: Give your shortcut a descriptive name (e.g., “Launch System Monitor”).
- Command: This is the exact terminal command or application binary you want to run. For example, to launch the system monitor, you would type
gnome-system-monitor. If you want to run a custom script, provide the absolute path (e.g.,/home/user/scripts/backup.sh). - Shortcut: Click the button that says “Set Shortcut…”, then physically press the key combination you want to use (e.g., Ctrl + Alt + M).
Once you click Add, your new shortcut is instantly active. You can press your chosen key combination from anywhere in the OS to trigger your command instantly.