Why GNOME keybindings silently resist customization

Note: This relates GNOME Shell 3.10 in Ubuntu 14.04. Other versions may differ and YMMV.

The keybindings of GNOME Shell can be changed using the system settings windows (All settings | Keyboard | Shortcuts). However, I have at times run into the feeling that these settings were only superficially customizable. Some keybindings would keep working the old way despite having their functionality set to another keybinding and some would seemingly ignore being disabled. GNOME keybindings seemed haunted by a ghost.

I’ve tracked down the ghost and the name of it is multiple keybindings. One functionality is often given to multiple key combos in the bowels of the system, not just one. The System settings window, however, only shows one, the first in the list. This means that if the keybinding you wish to assign to functionality A is secretly assigned to functionality B , the secret binding may overrule your attempts to use the keybinding. Only you won’t be asked to reassign the keybinding in system settings as that only checks the first, user-editable keybinding. A bug or a feature? You never really know with the GNOME development team.

You can kill these secret keybindings but not with system settings. Let’s get started using the dconf-editor.

I use Super + Up/Down rather than the old Ctrl + Alt + Up/Down to navigate the GNOME Shell workspace band. Hey, it saves a keypress. Supposing I would want to reassign Ctrl + Alt + Up to moving a window to the first workspace. In System settings | Keyboard | Shortcuts | Navigation I would double click the ‘Disabled’ text to the right of ‘Move window to workspace 1’ and hit Ctrl + Alt + Up. And it would get assigned.

Keyboard settingsHowever, it wouldn’t work as I intended. Ctrl + Alt + Up would still work the way it always has, supplementing Super + Up in going to the workspace above without moving any windows anywhere. The explanation for this behaviour is in the dconf-editor to the left in the screenshot. Ctrl + Alt + Up is still secretly assigned to switch-to-workspace-up next to Super + Up. In order for our reassignment to work we have to manually delete the secondary assignment of Ctrl + Alt + Up. Like this:

Keyboard settings 2Now Ctrl + Alt + Up moves the window to workspace 1 as intended.

Most of the GNOME keybindings can be found in the following dconf locations (as of 3.10):

/org/gnome/desktop/wm/keybindings
/org/gnome/mutter/keybindings

Annoyingly, the names used in the system settings window and the names of the settings in dconf do not always match. There’s not always a simple way to find out where the key-stealing ghost setting is located but here’s a tip that worked for me.

  1. Make a note of what functionality the keybinding seems to be secretly assigned to.
  2. Find that functionality in system settings and set it to the ½-sign (or something equally unused). Note that this is written ‘onehalf’.
  3. Run the following command in a terminal:
dconf dump /org/gnome/ | grep onehalf

dconf dump /ord/gnome spews out every setting under the /ord/gnome location and grep filters out every line that does not contain the word ‘onehalf’. The setting you just set should show up. Knowing the key name, it can easily be found in dconf-editor (the gui dconf tool) by hitting Ctrl + F and entering the name of the key. With a bit of luck and searching you should find your ghost setting.

I have debated with myself if I would recommend deleting every shortcut you do not use. On the plus side you will avoid these issues cropping up again. On the minus side you may unknowingly be using some – or will find a use for them in the future. I lean towards deletion. Secret settings suck.

Leave a Reply

Your email address will not be published. Required fields are marked *