Gnome

在 /etc/dconf/db/local.d 中為可重定位模式設置預設 gsettings

  • May 6, 2020

使用這樣的文件為我的所有使用者設置預設 gsettings/etc/dconf/db/local.d/my-settings工作正常:

[org/gnome/desktop/background]
picture-uri='file:///usr/local/share/backgrounds/wallpaper.jpg'

現在我正在嘗試設置一個自定義鍵綁定,這需要一個:PATH(可重定位的架構),如下所示:

[org/gnome/settings-daemon/plugins/media-keys/custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0]
name='keybinding-name'
command='my-command'
binding='my-keybinding'

不幸的是,執行後dconf update,配置值尚未設置:

$ gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/
org.gnome.settings-daemon.plugins.media-keys.custom-keybinding command '<newname>'
org.gnome.settings-daemon.plugins.media-keys.custom-keybinding name '<newname>'
org.gnome.settings-daemon.plugins.media-keys.custom-keybinding binding '<newname>'

如何正確設置這些值?

使用

[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0]

作品!

引用自:https://serverfault.com/questions/1015919