如何向空模式添加键?

如何向空模式添加键?

我想自动设置一些设置,特别是添加一些键盘快捷键~/.config/dconf/user。这是它在 dconf-editor 中的样子:

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

现在 gsettings (或 dconf)可以列出第一个:

$ gsettings get org.cinnamon.keybindings custom-list
['custom0', 'custom1', 'custom2', 'custom3']

但是,我看不到添加新键绑定甚至读取键的方法customX

$ gsettings get org.cinnamon.keybindings.custom-keybinding:/ custom0
No such key 'custom0'

例如,我怎样才能添加custom4带有binding='<Super>g'command='geany'、 的键name='Geany'

输出给 Donarssons 的答案:

$ 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
''

并在以下命令后进行截图。请注意,custom4 不会转到 custom-keybindings,而是转到 root。

gsettings set org.cinnamon.keybindings.custom-keybinding:/custom4/ binding '<Super>g'

设置值

我使用 Linux Mint 作为我的操作系统。

答案1

这是语法错误。下面应该可以:

$ 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

要设置新的热键:

$ 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'

相关内容