Gnome 3 / GSettings Sucks: Export/Importing your Keyboard shortcuts

Previous to Gnome 3 I had a nice simple flat file for my keyboard settings, that I just unzipped into .gconf and all was good. Now Gnome is copying the very bad idea of a registry from Windows, you have go through the gsettings API or tool.

Locate the keyboard shortcut schema “org.gnome.desktop.wm.keybindings”

Now lets “export” them

gsettings list-recursively org.gnome.desktop.wm.keybindings > keybindings

Now unfortunately there does not appear to be a way to import that file, so I just hacked the file. Adding “gsettings set” to the front and quoting the values.
So

org.gnome.desktop.wm.keybindings show-desktop ['<Super>d', '<Primary><Super>d', '<Super>d']

becomes

gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d', '<Primary><Super>d', '<Super>d']"

I’ve created some keybindins that use the Windows/Super key for window management, plus this don’t conflict with IntellJ

4 thoughts on “Gnome 3 / GSettings Sucks: Export/Importing your Keyboard shortcuts”

  1. Not too helpful, because
    gsettings list-recursively org.gnome.desktop.wm.keybindings > keybindings

    seems to havfe created a text-file representation of ONLY THE (or SOME?) builtin stuff, not (for instance) my own shortcuts.

    Is there a way to get ALL top-level key-shortcuts (i.e., all those not special to an application)?

  2. Do you have something similar to using super key to create new tabs, windows similar to Mac OS X?

    It’s faster to switch tabs, create new terminal windows and more and (i think i can put up your files in github for a fork)

    Thank you for this blog post.

  3. gsettings is just a High-Level-API for application settings. It can use different backends for storage.

    Most likely you use the dconf backend. You can export /import these settings with:

    dconf dump /org/gnome/desktop/wm/keybindings/ >keybindings-backup.dconf

    dconf load /org/gnome/desktop/wm/keybindings/
    <keybindings-backup.dconf

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.