gconftool的用法

来源:互联网 发布:淘宝助理怎么添加视频 编辑:程序博客网 时间:2024/06/06 00:58
gconftool是一个gconf的CLI前端,用法是很简单滴!

1. 列出所有子目录
语法:gconftool --all-dirs directory
stlxv@stlxvcomputer:~$ gconftool --all-dirs /
 
/desktop
 
/apps
 
/system
 
/schemas

2. 列出所有项
语法:gconftool -a directory
stlxv@stlxvcomputer:~$ gconftool -a /apps/panel/objects/object_2
 toplevel_id 
= top_panel_screen0
 bonobo_iid 
= 
 attached_toplevel_id 
= 
 use_custom_icon 
= true
 action_type 
= lock
 tooltip 
= 主菜单
 custom_icon 
= /home/stlxv/gnome-start-button/start_green.png
 launcher_location 
= 
 use_menu_path 
= false
 panel_right_stick 
= false
 object_type 
= menu-object
 position 
= 0
 locked 
= true
 menu_path 
= applications:/

3. 获取值
语法:gconftool --get entry
stlxv@stlxvcomputer:~$ gconftool --get /apps/panel/objects/object_2/custom_icon
/home/stlxv/gnome-start-button/start_green.png

4. 获取类型
语法:gconftool --get-type entry
stlxv@stlxvcomputer:~$ gconftool --get-type /apps/panel/objects/object_2/custom_icon
string

5. 设置值
语法:gconftool --type type --set entry value
gconftool --type bool --set /apps/panel/objects/object_2/use_custom_icon false


今天顺手做了个小程序,修改GNOME主菜单图标的(直接调用gconftool,虽然简单,但是比较慢)。以前用tr会导致乱码,但是用trUtf8就完全没有乱码了。
csdn的上传文件系统完全挂了,可执行程序在这里。
原创粉丝点击