Create / modify keyboard shortcuts in Gnome under Linux / UNIX

Q. Iā€™m using Ubuntu Linux and Iā€™d like to create or modify keyboard shortcuts in Gnome desktop system? How do I do it?

A. You need to use GConf-Editor or gnome keyboard shortcut tool. GConf-Editor is a tool used for editing the GConf configuration database. It might be useful when the proper configuration utility for some software provides no way of changing some option. The main window consists of a tree showing the GConf configuration database hierarchy, a list of the keys available, and documentation for the selected key. Key values can be changed by either changing them directly in the list, or right clicking on them and selecting Edit key. Changes take immediate effect in running programs. New keys can be added by right clicking in the list and selecting New key.

Easy to use – Keyboard Shortcuts tool

Use the Keyboard Shortcuts preference tool to customize the default keyboard shortcuts to your requirements.

Click on System > Preferences > Keyboard Shortcuts to launch the application and view the preconfigured shortcuts.
Create / modify keyboard shortcuts in Gnome under Linux / UNIX  with Keyboard Shortcuts tool

To edit a keyboard shortcut, perform the following steps:

  1. Click the action in the list. If you are using the the keyboard, use the arrow keys to select the shortcut and press Return.
  2. Press the new key or key combination you want to assign to the action.
  3. To clear a shortcut, press Backspace. The action is now marked as Disabled.
  4. To cancel assigning a shortcut, click elsewhere in the window or press Escape.

Advance keyboard shortcuts tool – gconf-editor (GConf-Editor)

You need to install this tool using any one of the following command (Debian / Ubuntu Linux):
$ sudo apt-get install gconf-editor
Or if you are using Fedora / CentOS /RHEL Linux:
# yum install gconf-editor

Run gconf-editor

Use menus or type a command as follows:
$ gconf-editor &

  • Next double click the “apps” folder
  • Next double click the “metacity” folder
  • Finally click the global_keybindings folder


Please note that all these keyboard shortcuts and other settings are saved on a user basis (inside a home directory), so each user can create their own custom setup.

šŸ§ Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

šŸ§ 16 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
16 comments… add one
  • Dan Feb 5, 2008 @ 14:25

    thanks for that, exactly what i needed, I wanted to set a keyboard shortcut to start a particular program. your gconf-editor tip did it for me.

  • Denis May 27, 2008 @ 23:58

    Very nice topic ! Almoust exactly what i was looking for. I got a problem with shortcuts in Fedora 9. I can not assign the keyboard shotrtcut for HOME directory. It seems to be set in a right way and I also have xml file for this shortcut but it does not works. If you have some idea in mind … I will be thankful.

  • Velu Nov 10, 2008 @ 6:37

    i need fedora 9 32 bit nots from online please

  • Dougle Dec 3, 2008 @ 1:41

    was the key name for my left super (Windows) key, in case any one wondered.

    Thanks for the tip Vivek.

  • tipsy Aug 3, 2009 @ 6:47

    global_keybindings (run_command_1 to _10) can be set to keybindings (P, just type it in literally), then set the corresponding command in keybindings_commands (command_1 = pidgin). This way you get to set ten commands without overriding any other keyboard shortcuts.

  • tipsy Aug 3, 2009 @ 6:52

    Hm, there needs to be an %3CALT%3E%3CCTRL%3E in front of that (hope this works :)

  • Gordon Sep 6, 2009 @ 1:28

    What file does the key binding info get stored in?
    When I want to do a key combo with the window button e.g. “Mod4(windows) + t” it won’t let me. I’d like to edit the file directly.

  • Prakash May 11, 2010 @ 11:41

    is there a manual way to assign kbd shortcuts in Gnome? ‘coz in 10.04 Ubuntu ,Gnome-2.30 has disabled these options for the app I wanted to assing kbd shortcut – gnome-terminal.
    any IdeA?

  • Vamsi Jun 6, 2010 @ 16:46

    from command line ;)

    gconftool-2 –type=string –set /apps/metacity/global_keybindings/run_command_1 ‘l’

    gconftool-2 –type=string –set /apps/metacity/keybinding_commands/command_1 ‘bot’

    assigns control + l for a command called bot

  • Philippe Petrinko Jun 24, 2010 @ 14:53

    Basic tip – but still useful – Thanks Vivek

  • Anthalamus Jun 28, 2010 @ 20:28

    Gordon, they are stored per user under ~/.gconf by default. Something like:
    (find . | xargs grep your_shortcut_name) 2> /dev/null
    should help you find the exact file for your shortcut. Not sure you can use the Windows key though

  • bobbyshane Aug 23, 2010 @ 21:04

    Is there possibly a way to assign a key command to another key? For instance the Up key could be executed by hitting Ctrl-e, Down key with Ctrl-x, left key with Ctrl-s and right key Ctrl-d like in Wordstar. I’m trying to find a way to setup linux to globally use the Wordstar command set. You can do it in windows with Ctrlplus and it can be done in Tcsh, but I can’t seem to find a way to do so within X. Xmodmap doesn’t seem to be able to do this either. You can swap keys but not a key for a key command.

  • Ripon Majumder Aug 13, 2011 @ 14:15

    Thanks a lot for that, It works and enable Volume Mute button of my Dell Latitude D630. Thanks again.

  • LenW Aug 24, 2011 @ 18:49

    Is there a way to set a keyboard shortcut for an ordinary mouse left-click?
    Often in slideshows, there are many clicks made to the same mouse position.
    I think it would be easier on my hand to press a key (perhaps function key)
    than holding my hand over the mouse.
    (I am running Gnome 2 under Ubuntu 10.04)

  • Marco Sep 21, 2013 @ 1:39

    Is there any way to disable the default LMB shortucut? Using 3d packages I need it for other functions ……. :(

    • Marco Sep 21, 2013 @ 1:47

      ok … was mouse_button_modifier in metacity – general
      Now I set it to +q

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum