Add a custom keybinding with gsettings in ubuntu

I can modify existing custom keybindings like this:

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name "browser"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command "/home/kaiyin/workspace/bash_scripts/focusRun.sh chromium-browser"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding "<Primary><Shift><Alt>b"

But how do I add a new one?


Additionally to setting name, command and binding do you also need to change the custom-keybindings array assigning all paths you have assigned keybindings too.

The path in your example would be /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ and following command would assign this path to the custom-keybindings key:

gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']"