How to add custom keybindings using gsettings

HI,
I’m try to add custom keybindings using gsettings, but I can’t find path to add it. Here example how to do it in cinnamon

So any idea what I must write instead of HELP:
gesttings set $HELP:/org/mate/desktop/keybindings/custom3/ name KEYname
gesttings set $HELP:/org/mate/desktop/keybindingscustom3/ binding KEYname
gesttings set $HELP:/org/mate/desktop/keybindings/custom3 action KEYname

You need to install mate-desktop-gsettings-schemas (reference: Please make it possible to add custom keybindings in MATE (#47) · Issues · GNOME / gsettings-desktop-schemas · GitLab)

1 Like

Welcome @davidhedlund to the community!

I've always just used the Menu / Preferences / Keyboard Shortcuts GUI tool. Would that work for you?

1 Like

I would be hesitant to reset the dconf database without first backing it up.
how to here:
https://linuxconfig.org/introduction-to-the-dconf-configuration-system

"Both dconf-editor and gsettings also allows you to change preferences for the current user." from here:
https://help.gnome.org/admin/system-admin-guide/stable/gsettings-browse.html.en
My backup has saved me more than once.
Just a thought

3 Likes

It should be

gsettings set org.mate.desktop.keybindings.custom3  name keyname

These are the schemas that exist:

org.mate.Marco.global-keybindings
org.mate.Marco.window-keybindings
org.mate.terminal.keybindings
org.mate.SettingsDaemon.plugins.keybindings

But the schema org.mate.desktop.keybindings does not exist.
(you can check this with dconf-editor)

So gsettings is not going to work anyway.
You are probably better off with the dconf command.

dconf dump / |grep keybindings

shows:

[org/mate/desktop/keybindings/custom0]
[org/mate/desktop/keybindings/custom1]
[org/mate/desktop/keybindings/custom10]
[org/mate/desktop/keybindings/custom11]
[org/mate/desktop/keybindings/custom12]
[org/mate/desktop/keybindings/custom2]
[org/mate/desktop/keybindings/custom3]
[org/mate/desktop/keybindings/custom4]
[org/mate/desktop/keybindings/custom5]
[org/mate/desktop/keybindings/custom6]
[org/mate/desktop/keybindings/custom7]
[org/mate/desktop/keybindings/custom8]
[org/mate/desktop/keybindings/custom9]
[org/mate/marco/global-keybindings]
[org/mate/marco/window-keybindings]
[org/mate/terminal/keybindings]

To get a value:

dconf read /org/mate/desktop/keybindings/custom5/action

gives on my setup:

'mate-control-center'

so if you want to write a custom action you would do something like:

dconf write /org/mate/desktop/keybindings/custom5/action 'shutdown -h now'

If you want to list all the keybindings:

dconf dump /org/mate/desktop/keybindings/
dconf dump /org/mate/marco/global-keybindings/
dconf dump /org/mate/marco/window-keybindings/
dconf dump /org/mate/terminal/keybindings/
3 Likes