How to add a key to an empty schema?
8,964
It's a syntax error. This should work:
$ gsettings get org.cinnamon.keybindings.custom-keybinding:/org/cinnamon/keybindings/custom-keybindings/custom0/ binding
<Super>e
$ gsettings get org.cinnamon.keybindings.custom-keybinding:/org/cinnamon/keybindings/custom-keybindings/custom0/ command
nemo
$ gsettings get org.cinnamon.keybindings.custom-keybinding:/org/cinnamon/keybindings/custom-keybindings/custom0/ name
nemo
To set a new hotkey:
$ gsettings set org.cinnamon.keybindings.custom-keybinding:/org/cinnamon/keybindings/custom-keybindings/custom4/ binding '<Super>g' &&
gsettings set org.cinnamon.keybindings.custom-keybinding:/org/cinnamon/keybindings/custom-keybindings/custom4/ command 'geany' &&
gsettings set org.cinnamon.keybindings.custom-keybinding:/org/cinnamon/keybindings/custom-keybindings/custom4/ name 'Geany'
Related videos on Youtube
Author by
Simon A. Eugster
Updated on September 18, 2022Comments
-
Simon A. Eugster over 1 year
I would like to automate setting some settings, specifically add some keyboard shortcuts to
~/.config/dconf/user
. Here is how it looks in dconf-editor:Now gsettings (or dconf) can list the first one:
$ gsettings get org.cinnamon.keybindings custom-list ['custom0', 'custom1', 'custom2', 'custom3']
However, I cannot see a way to then add a new keybinding, or even to read the
customX
keys.$ gsettings get org.cinnamon.keybindings.custom-keybinding:/ custom0 No such key 'custom0'
How can I add, for example, a
custom4
key withbinding='<Super>g'
,command='geany'
,name='Geany'
?Output to Donarssons answer:
$ gsettings get org.cinnamon.keybindings.custom-keybindings:/custom0/ binding No such schema 'org.cinnamon.keybindings.custom-keybindings' $ gsettings get org.cinnamon.keybindings.custom-keybinding:/custom0/ binding ''
And screenshot after the following command. Note that custom4 does not go to custom-keybindings but to the root.
gsettings set org.cinnamon.keybindings.custom-keybinding:/custom4/ binding '<Super>g'
I'm using Linux Mint as my O/S.
-
Donarsson about 10 yearsThis is NOT off-topic, the question is fully applicable to Cinnamon on Ubuntu and mostly valid for Unity and GNOME (the schemas are named differently there, but the names are of no concern for the actual issue described here).
-
Braiam about 10 years@Donarsson anything about Mint, even if it applies to Ubuntu is off topic, otherwise we would be accepting Debian questions just because they apply to Ubuntu in some cases. If you had read the comments on the accepted answer you would notice that "ubuntu guys" wasn't able to deal effectively with the question since there was missing information. Further discussions bring them to meta.
-
Simon A. Eugster about 10 yearsI agree that the specific example of setting a cinnamon keyboard shortcut is not Ubuntu. The question though is how to add a key to an empty schema in dconf, and dconf is not Ubuntu specific.
-
Bruno Pereira about 10 yearsYes that is all true and relevant, even for the zillions of tools that are common to all the Linux distros out there,
but org.cinnamon.keybindings.custom-keybindings
is Mint specific and does not exist in Ubuntu. -
Donarsson about 10 yearsI could recreate the screenshots and everything in Ubuntu and edit the question and answer accordingly, if that helps. Then it might be useful for other Ubuntu users in the future.
-
Oli about 10 years@Donarsson Fire away.
-
web.learner about 10 years@Donarsson Please, go for it.
-
web.learner about 10 years@Braiam Stop it. Just stop it. Oli is fine with it. Besides, updating the screenshots isn't going to change the question. It's about dconf not Mint.
-
Braiam about 10 years@Seth migrate it then
-
-
web.learner about 10 yearsWere you going to update the screenshots? I know you mentioned it above.
-
lucidbrot about 4 yearsWhat if the schema
custom-keybindings
does not exist yet (for setting a new hotkey)? -
lucidbrot about 4 yearsI resolved my issue, nevermind :)