首页 > 代码库 > Gconf与Gsettings的简介、及gsettings的具体使用案例
Gconf与Gsettings的简介、及gsettings的具体使用案例
/*********************************************************************
* Author : Samson
* Date : 12/11/2014
* Test platform:
* 3.13.0-24-generic
* GNU bash, 4.3.11(1)-release
* *******************************************************************/
GConf was a system used by theGNOME desktop environment for storingconfiguration settings for the desktop and applications. It is similar to the Windows Registry.
Gconf是一个存储GNOME桌面环境配置的一个系统,以方便桌面和应用程序的配置,是后台运行的。可以理解为是一个类似于windows下的注册表的一个东西;
而gsettings是对GConf后台的读取和设置;
现就举一个例子:
在面板中使用了panel-launchers的key,那么如何得到这个的值呢?
第一步:
ufo@ufo:~$ gsettings list-schemas | grep cinnamon
可查找到cinnamon对应的方案为org.cinnamon
第二步,在此方案中查找key的值:
ufo@ufo:~$ gsettings list-recursively org.cinnamon | grep -w "panel-launchers"
org.cinnamon enabled-applets [‘panel1:left:0:menu@cinnamon.org:0‘, ‘panel1:left:1:show-desktop@cinnamon.org:1‘, ‘panel1:left:2:panel-launchers@cinnamon.org:2‘, ‘panel1:left:3:windowPreviewWindowList@dalcde:3‘, ‘panel1:right:0:notifications@cinnamon.org:4‘, ‘panel1:right:1:settings@cinnamon.org:5‘, ‘panel1:right:2:removable-drives@cinnamon.org:6‘, ‘panel1:right:3:bluetooth@cinnamon.org:7‘, ‘panel1:right:4:network@cinnamon.org:8‘, ‘panel1:right:5:sound@cinnamon.org:9‘, ‘panel1:right:6:power@cinnamon.org:10‘, ‘panel1:right:7:systray@cinnamon.org:11‘, ‘panel1:right:8:cpu-monitor@iscas.as.cn:12‘, ‘panel1:right:9:calendar@cinnamon.org:13‘, ‘panel1:right:10:windows-quick-list@cinnamon.org:14‘]
org.cinnamon panel-launchers [‘firefox.desktop‘, ‘gnome-screenshot.desktop‘, ‘gnome-terminal.desktop‘, ‘thunderbird.desktop‘, ‘fcitx-configtool.desktop‘, ‘cinnamon-custom-launcher-3.desktop‘]
org.cinnamon panel-launchers-draggable true
org.cinnamon enabled-applets [‘panel1:left:0:menu@cinnamon.org:0‘, ‘panel1:left:1:show-desktop@cinnamon.org:1‘, ‘panel1:left:2:panel-launchers@cinnamon.org:2‘, ‘panel1:left:3:windowPreviewWindowList@dalcde:3‘, ‘panel1:right:0:notifications@cinnamon.org:4‘, ‘panel1:right:1:settings@cinnamon.org:5‘, ‘panel1:right:2:removable-drives@cinnamon.org:6‘, ‘panel1:right:3:bluetooth@cinnamon.org:7‘, ‘panel1:right:4:network@cinnamon.org:8‘, ‘panel1:right:5:sound@cinnamon.org:9‘, ‘panel1:right:6:power@cinnamon.org:10‘, ‘panel1:right:7:systray@cinnamon.org:11‘, ‘panel1:right:8:cpu-monitor@iscas.as.cn:12‘, ‘panel1:right:9:calendar@cinnamon.org:13‘, ‘panel1:right:10:windows-quick-list@cinnamon.org:14‘]
org.cinnamon panel-launchers [‘firefox.desktop‘, ‘gnome-screenshot.desktop‘, ‘gnome-terminal.desktop‘, ‘thunderbird.desktop‘, ‘fcitx-configtool.desktop‘, ‘cinnamon-custom-launcher-3.desktop‘]
org.cinnamon panel-launchers-draggable true
可看出panel-launchers的值。
Ref:
http://en.wikipedia.org/wiki/GConf
http://wiki.mate-desktop.org/docs:gsettings
Gconf与Gsettings的简介、及gsettings的具体使用案例
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。