gpt4 book ai didi

ubuntu - Gsettigs 和 dconf 设置热键

转载 作者:太空宇宙 更新时间:2023-11-03 16:57:23 25 4
gpt4 key购买 nike

你好
我需要在ubuntu 12.10中设置一个热键,我使用

设置(dconf)

~$ gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ binding '<Primary><Alt>s'
~$ gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ binding '<Primary><Alt>s'
~$ gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ command 'gnome-terminal'

但是当我看到这个模式时,我只看到了

~$ gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings
~$ @as []

但是当我使用 dconf 查看这个模式时

~$ dconf list /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/
binding
command

我做错了什么?谢谢。

最佳答案

您忘记设置父键的值:custom-keybindings,类型为 @as[]。首先检查它是否为空:

gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings

如果它是空的:[],运行:

gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/']"

如果它不为空,则必须将现有值添加到上述命令中(值必须用单引号括起来并用逗号 + 空格分隔,如 ['val1', 'val2', 'val3' ])。然后运行:

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/custom2/ binding '<Primary><Alt>s'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/custom2/ command 'gnome-terminal'

关于ubuntu - Gsettigs 和 dconf 设置热键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14379164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com