Friday, December 25, 2015

How to save custom shortcuts or keybindings on debian GNOME

According to ubuntu reference dconf is the most appropriate tool to manage shortcuts. Custom keybindings are stored in /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/, so we do

dconf dump /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ > bkp

and bkp contains something like this:
[custom1]
binding='<Primary><Alt>t'
command='gnome-terminal &'
name='console'

[custom2]
binding='<Shift>Print'
command='gnome-screenshot -a'
name='screenshot-to-/home/asalle/Pictures'

[custom3]
binding='<Primary><Alt>i'
command='iceweasel'
name='iceweasel'

After this, put the bkp file into the cloud or elsewhere, where it can be safe and restore keybindings, if necessary, with:

 dconf load /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ < bkp

Sorry, guys, I haven't tried the last one, so I am not sure if it works.