桌面主题可以通过gconf-editor图形化工具手动查看修改,也可以通过gconftool-2命令行工具修改多个配置。
方法一、通过命令行工具修改默认主题。
1、导出当前需修改的默认配置:
gconftool-2 --dump /apps/panel > my-edit-default.xml
2、按照需要,修改my-edit-default.xml文件,具体改动位置可通过gconf-editor工具查看,面板的注册表路径在/apps/panel下面。
3、修改完毕后,需要将缺省配置源的值设置为my-edit-default.xml文件中的值,使用命令:(注意需要先将my-edit-default.xml文件的用户组权限改为root,否则会提示拒绝访问)
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --load my-edit-default.xml
4、注销测试用户帐号
方法二、直接修改缺省配置源文件:
缺省配置源文件在 /etc/gconf/gconf.xml.defaults/%gconf-tree.xml。具体改动位置仍可通过gconf-editor工具查看。
注意:方法一、和方法二都是修改的缺省源。如果有强制源和用户源存在,则会优先获。例子:
只显示top面板,不要bottom面板
/apps/panel/general/toplevel_id_list
将top面板放在桌面下方
/apps/panel/toplevels/top_panel/orientation
将Menu Bar改为Main Menu风格
/apps/panel/objects/menu_bar/object_type的值由menu-bar改为menu-object,/apps
/panel/objects/menu_bar/tooltip的值改为Main Menu
制定面板的applet和object
/apps/panel/general/applet_id_list和/apps/panel/general/object_id_list
调整applet和object的属性(位置、大小、图片、颜色、toplevel_id)
/apps/panel/applets和/apps/panel/objects
调整top面板背景的方案、颜色和透明度
方案/apps/panel/toplevels/top_panel/background/type
颜色
/apps/panel/toplevels/top_panel/background/color
透明度/apps/panel/toplevels/top_panel/background/opacit
附以上例子shell脚本:
- #/bin/bash
-
#date 2011-12-31
-
#make by leotody
-
-
#only show top_panel
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=list --list-type=string /apps/panel/general/toplevel_id_list [top_panel]
-
#move top_panel to bottom
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/toplevels/top_panel/orientation "bottom"
-
#change menu_bar to main_menu
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/objects/menu_bar/object_type "menu-object"
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/objects/menu_bar/tooltip "Main Menu"
-
#change top_panel backgroud color/opacity/type
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/toplevels/top_panel/background/color "#8ca6c8"
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=int /apps/panel/toplevels/top_panel/background/opacity 17694
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/toplevels/top_panel/background/type "color"
-
#change top_panel's applets and objects
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=list --list-type=string /apps/panel/general/applet_id_list [clock,systray,window_list,workspace_switcher,trash_applet,fast_user_switch_applet]
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=list --list-type=string /apps/panel/general/object_id_list [menu_bar,web_launcher]
-
#change applets and objects propertys
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=bool /apps/panel/applets/clock/prefs/show_date false
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=bool /apps/panel/applets/clock/prefs/show_temperature false
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=bool /apps/panel/applets/clock/prefs/show_weather false
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/applets/clock/prefs/format "24-hour"
-
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/applets/trash_applet/toplevel_id "top_panel"
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=int /apps/panel/applets/trash_applet/position 2
-
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/applets/workspace_switcher/toplevel_id "top_panel"
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=bool /apps/panel/applets/workspace_switcher/panel_right_stick false
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=int /apps/panel/applets/workspace_switcher/position 2
-
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=int /apps/panel/applets/systray/position 3
-
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=string /apps/panel/applets/window_list/toplevel_id "top_panel"
-
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=int /apps/panel/applets/window_list/position 3
参考链接:
https://www.ibm.com/developerworks/cn/linux/l-cn-gconf/
阅读(1437) | 评论(0) | 转发(0) |