15

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:

org.cinnamon.keybindings org.cinnamon.keybindings.custom-keybindings.custom0

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 with binding='<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'

gsetting the value

I'm using Linux Mint as my O/S.

fossfreedom
  • 172,746
  • 12
    This 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). – Donarsson Mar 05 '14 at 22:54
  • 1
    @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. – Braiam Mar 05 '14 at 23:54
  • 3
    I 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. – Simon A. Eugster Mar 06 '14 at 07:09
  • 2
    Yes 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. – Bruno Pereira Mar 06 '14 at 07:50
  • I 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. – Donarsson Mar 06 '14 at 15:50
  • 1
    @Donarsson Fire away. – Oli Mar 06 '14 at 17:13
  • @Donarsson Please, go for it. – Seth Mar 07 '14 at 01:48
  • @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. – Seth Mar 08 '14 at 04:59

1 Answers1

16

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'
Donarsson
  • 2,709
  • 21
  • 31