4

I am looking to copy the keyboard shortcuts file to another PC to avoid re-binding the keys again. I am using Ubuntu Gnome 16.04.

In Xubuntu there is a simple location with the keyboard shortcuts in a file in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml. You can copy and paste this file to another computer, and you have all your familiar keyboard shortcuts. Is there an equivalent file in Ubuntu Gnome?

Rockishi
  • 603

2 Answers2

4

Also here.

Save custom keyboard shortcuts

You can save/backup/export custom shortcuts/keybindings using just dconf and sed

Export

dconf dump / | sed -n '/\[org.gnome.settings-daemon.plugins.media-keys/,/^$/p' > custom-shortcuts.conf # Export

The difference with the usual answer is that this will hold on the file the path to the dconf settings, making it easier to import, just dconf load / < file.

Import

dconf load / < custom-shortcuts.conf # Import

Notes

  • Based on Ciro's answer (also here)

  • Only for the added custom shortcuts

  • Note that dconf only dumps non-default values

  • To backup, you may want to use custom-shortcuts-$(date -I).conf

  • Test if it works by resetting to defaults before the import

    gsettings reset-recursively org.gnome.settings-daemon.plugins.media-keys
    
Pablo Bianchi
  • 15,657
4

GNOME stores its settings in the dconf binary database which can also be viewed or changed with the gsettings command line tool or the dconf-editor app.

The database is stored in ~/.config/dconf/user . You can copy that file to another computer to copy all of your GNOME settings including your keyboard shortcuts. That folder is hidden by default. Use the keyboard shortcut Ctrl+H to view hidden folders.

Other apps store their settings in other parts of the ~/.config folder or directory.

Jeremy Bicha
  • 8,234