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'
Share:
8,964

Related videos on Youtube

Simon A. Eugster
Author by

Simon A. Eugster

Updated on September 18, 2022

Comments

  • Simon A. Eugster
    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:

    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.

    • Donarsson
      Donarsson about 10 years
      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).
    • Braiam
      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
      Simon A. Eugster about 10 years
      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.
    • Bruno Pereira
      Bruno Pereira about 10 years
      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.
    • Donarsson
      Donarsson about 10 years
      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.
    • Oli
      Oli about 10 years
      @Donarsson Fire away.
    • web.learner
      web.learner about 10 years
      @Donarsson Please, go for it.
    • web.learner
      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
      Braiam about 10 years
  • web.learner
    web.learner about 10 years
    Were you going to update the screenshots? I know you mentioned it above.
  • lucidbrot
    lucidbrot about 4 years
    What if the schema custom-keybindings does not exist yet (for setting a new hotkey)?
  • lucidbrot
    lucidbrot about 4 years
    I resolved my issue, nevermind :)