Setting up proper keyboard shortcuts in gnome
We all know the default keyboard shortcuts in gnome are useless, especially compared to something like fluxbox.
Why can’t you just hook up a command to a keyboard shortcut?
The possibilities would be endless. Press f2 and your sound volume decreases by 5%, press alt+f3 and synaptic launches.
This can be done with a tool called xbindkeys.
Open up a terminal (applications -> accessories -> terminal) and copy/paste this command.
sudo apt-get install xbindkeys-config
(apt will take care of the rest)
2. Add to menu
The app didn’t come up in my applications menu, so let’s add it.
Open up “system -> preferences -> main menu”.
I suggest you add it to “system tools”.
Highlight “system tools” in the left plane of the interface. The press “new item” in the right side off the interface.
This box will pop up.
For those unable to see the picture, you would enter this:
Comment: Application to set keyboard shortcuts.
You can make up what you put in “name” and “comment”.
Press close and the app will be in your applications menu.
Before opening it, run this command in a terminal (press the “copy to clipboard button!)
xbindkeys --defaults > $HOME/.xbindkeysrc
This will create a config file, without it xbindkeys will crash.
4. Create shortcuts
Open the app and you’ll see an ugly interface. Oh well, it’s not like you need to use it every day. Once configured you’ll most likely never touch it again.
I’m going to set up a keyboard shortcut for synaptic package manager. After that you should be able to set up your own.
You might already see a few shortcuts in there already.
Press the “new” button in the bottom of the interface.
In the right plane of the interface, enter a name.
Since we are setting a shortcut for synaptic, let’s call it “Synaptic”.
Then press the get key. A little box will appear. Just enter the shortcut you would like to use.
I used “alt + f3”.
Then in the “Action:” box enter the command you would like to use. In this case that would be
Then press “run action”.
After that press “apply” and the keyboard shortcut will be created.
If you are done, press “file -> save to default file”. Or else they will be gone if you log out!!!
5. Some more.
I’m just going to list some commands that could be useful to bind to a shortcut.
Note: remember the Main Menu, the app where you can add entries to the menu? Right – click on an application and press “properties”. The command to launch it will be displayed there.
The command for most audio players is just the name of the app.
For exaile, use “exaile”. For rhythmbox, use “rhythmbox”.
Same for movie players.
For “Movie Player” use “totem”, for vlc media player use “vlc”.
What if you want to assign hotkeys to manage the volume (might only work if using ALSA)?
amixer sset Master,0 5%-
# lower volume by 5%
amixer sset Master,0 5%+
# turn up volume by 5%
amixer sset Master,0 toggle
# mute volume
Open the Home directory.
What if you want to open the file manager as root?
What if you want the add/remove gui for apt instead of synaptic?
Or lets say you want to launch the system monitor (maybe add it to ctrl + alt +del for lulz)
As you see, the options are limitless.
This is mine. It’s on a fresh install of Ubuntu, so I still need to add some things things to it (scripts, …).
If you have any usefull commands you use, please share them in the comments.