[Linux] 使用 gsettings 和 dconf-editor 修改 GNOME desktop 設定

[Linux] 使用 gsettings 和 dconf-editor 修改 GNOME desktop 設定

之前在寫 用 Mac 連上 CentOS 7 的 vino VNC server 這一篇時,

有用到 gsettings 這個指令,

查了一下,gsettings 是用來調整 GNOME desktop 的一些設定的工具,

查一查也發現它有對應的 GUI 版本 dconf-editor,

不過試用了一下,還是 gsettings 比較容易用一些~

 

舉例來說,像我想查 Vino VNC server 相關的設定,

可以用 gsettings list-recursively 加上 grep 來過濾,

用這個方法就可以找到 require-encryption 這個設定值:

testuser@localhost ~ $ gsettings list-recursively | egrep -i vino
org.gnome.Vino notify-on-connect true
org.gnome.Vino alternative-port uint16 5900
org.gnome.Vino disable-background false
org.gnome.Vino use-alternative-port false
org.gnome.Vino icon-visibility 'client'
org.gnome.Vino use-upnp false
org.gnome.Vino view-only false
org.gnome.Vino prompt-enabled false
org.gnome.Vino disable-xdamage false
org.gnome.Vino authentication-methods ['vnc']
org.gnome.Vino network-interface ''
org.gnome.Vino require-encryption false
org.gnome.Vino mailto ''
org.gnome.Vino lock-screen-on-disconnect false

 

用 dconf-editor 也可以作到,但跟 gsettings 有點無法對應…

安裝很簡單:

sudo yum -y install dconf-editor

 

接著執行 Applications > System Tools > dconf Editor,就能看到下面的畫面,

可以一個個分類的選項打開來看和修改~

但是… 剛剛在 gsettings 裡面查到的 org.gnome.Vino 分類,

在 dconf Editor 裡卻是 org/gnome/desktop/remote-access,

完全不曉得這是要如何對應過來,而且也不能搜尋,真的不太好用…

(唯一的好處是可以一個個打開來看有什麼選項吧)

Screenshot from 2015-12-31 13-22-52  

 

參考資料:

What is dconf, what is its function, and how do I use it?

 

(本頁面已被瀏覽過 4,165 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料