openKylin论坛

 找回密码

Ubuntu 主题制作和设置教程 [复制链接]

本帖最后由 没底的瓶子 于 2013-3-11 09:44 编辑

                        
Ubuntu主题制作和设置教程
v0.3
瓶子


依赖:
13.04gsettings-desktop-schemas

壁纸
usr/share/backgrounds下放入壁纸文件
12.04
usr/share/gnome-background-properties/ubuntu-wallpapers.xml更改系统默认壁纸
/usr/share/gnome-background-properties/precise-wallpapers.xml加入新壁纸信息
gsettingsset org.gnome.desktop.background  picture-uri 'file:///usr/share/backgrounds/x.jpg'设定桌面背景


默认登陆界面背景
[com.canonical.unity-greeter]
background="/usr/share/backgrounds/ubuntukylin.png"

GTK窗口主题
usr/share/themes~/.themes下放入主题文件夹(包括GTK和窗口主题相关文件)
12.04:
gsettingsset org.gnome.desktop.interface gtk-theme themename  设定GTK主题
gconftool-2--set --type string /apps/metacity/general/theme  themename 设定窗口主题
13.04:
gsettingsset org.gnome.desktop.interface gtk-theme themename  设定GTK主题
gsettingsset org.gnome.desktop.wm.preferences  theme  themename 设定窗口主题


gsettingsget org.gnome.desktop.interface gtk-theme" 得到当前GTK主题名

图标和光标主题
usr/share/icon~/.icon下放入主题文件夹(包括图标和光标相关文件)
theme中的主题信息文件中指定
12.04
gsettingsset org.gnome.desktop.interface icon-theme iconname 设定图标主题
gconftool-2--set --type string /desktop/gnome/peripherals/mouse/cursor_theme kylin-icon-theme设定光标主题
ln-sf /usr/share/icons/kylin-icon-theme/cursor.theme/etc/alternatives/x-cursor-theme

13.04
gsettingsset org.gnome.desktop.interface icon-theme iconname 设定图标主题
gsettingsset org.gnome.desktop.interface cursor-theme  cursorname 设定光标主题
ln-sf /usr/share/icons/kylin-icon-theme/cursor.theme/etc/alternatives/x-cursor-theme

update-alternatives--config x-cursor-theme 设定图标主题
gsettingsget org.gnome.desktop.interface icon-theme" 得到当前图表主题名
theme中的主题信息文件中指定各类主题的名称。



自动配置光标主题:
使用alternatives机制

  •         /etc/X11/cursors/xxxx.theme
  •         安装主题

root@debian:~# cd /etc/alternativesroot@debian:/etc/alternatives# update-alternatives --install x-cursor-theme x-cursor-theme /etc/X11/cursors/Gold.theme 70

  •         由于x-cursor-theme使用了自动配置方式,而优先级70为最高级别,所以Gold.theme已自动设置为默认配置了,可用以命令查询:
    update-alternatives --display x-cursor-theme

xin@xin-Inspiron-620s:~$ update-alternatives --display x-cursor-theme
x-cursor-theme - 自动模式
链接目前指向 /usr/share/icons/DMZ-White/cursor.theme
/etc/X11/cursors/core.theme - 优先级 30
/etc/X11/cursors/handhelds.theme - 优先级 20
/etc/X11/cursors/redglass.theme - 优先级 20
/etc/X11/cursors/whiteglass.theme - 优先级 20
/usr/share/icons/DMZ-Black/cursor.theme - 优先级 30
/usr/share/icons/DMZ-White/cursor.theme - 优先级 90
目前“最佳”的版本为 /usr/share/icons/DMZ-White/cursor.theme。

  • 若为手动模式,需将其设为自动模式:update-alternatives        --auto x-cursor-theme


  •         这样鼠标主题已生效。

摘自系统默认光标主题包:dmz-cursor-themepsotinst脚本

  •         update-alternatives        --install /usr/share/icons/default/index.theme \

  •                 x-cursor-theme        /usr/share/icons/DMZ-White/cursor.theme 90

  •         update-alternatives        --install /usr/share/icons/default/index.theme \

  •                x-cursor-theme        /usr/share/icons/DMZ-Black/cursor.theme 30

系统默认主题的设置
更改/usr/share/glib-2.0/schemas目录下xml文件中相应项目的键值来达到更改系统默认设置的目的。也可用10_xxx.xxxx.override文本文件来覆写相应键值(前面数字为优先级)
override文本文件的内容可如下写:
[org.gnome.desktop.interface]
gtk-theme="kylin-theme"
icon-theme="kylin-icon-theme"

[org.gnome.desktop.wm.preferences]
theme="kylin-theme"

[com.canonical.unity-greeter]
background="/usr/share/backgrounds/ubuntukylin-default-settings.jpg"

可用glib-compile-schemas命令,然后注销查看更改效果。
glib-compile-schemas编译所有的GSettings方案文件为方案缓存。

gsettings全局设置所在位置:
/usr/share/glib-2.0/schemas/
cache位置:
/home/socol/.config/dconf/user

楼主
发表于 2013-3-11 09:39:55
回复

使用道具 举报

Ubuntu 主题制作和设置教程 [复制链接]

占位,预留
沙发
 楼主| 发表于 2013-3-11 09:45:36
回复

使用道具 举报

Ubuntu 主题制作和设置教程 [复制链接]

楼主:

默认登陆界面背景
[com.canonical.unity-greeter]
background="/usr/share/backgrounds/ubuntukylin.png"

这是哪个文件呀?
问题2:主题该如何制作呀?
板凳
发表于 2013-3-25 11:17:13
回复

使用道具 举报

Ubuntu 主题制作和设置教程 [复制链接]

jonaszhang 发表于 2013-3-25 11:17
楼主:

默认登陆界面背景

系统挂了 还没完全修复 之前写的文档很有帮助 修复有望了{:3_41:}
最下面有写:
系统默认主题的设置
更改/usr/share/glib-2.0/schemas目录下xml文件中相应项目的键值来达到更改系统默认设置的目的。也可用10_xxx.xxxx.override文本文件来覆写相应键值(前面数字为优先级)
override文本文件的内容可如下写:
[org.gnome.desktop.interface]
gtk-theme="kylin-theme"
icon-theme="kylin-icon-theme"
地板
 楼主| 发表于 2013-3-25 12:37:02
回复

使用道具 举报

Ubuntu 主题制作和设置教程 [复制链接]

学习了 试试看
5#
发表于 2013-3-25 21:37:55
回复

使用道具 举报

Ubuntu 主题制作和设置教程 [复制链接]

这个必须支持,感谢楼主分享
6#
发表于 2013-4-3 18:22:47
回复

使用道具 举报

Ubuntu 主题制作和设置教程 [复制链接]

研究主题制作中,学习学习~~。《
7#
发表于 2014-3-5 15:30:43
回复

使用道具 举报

openKylin

GMT+8, 2024-5-5 18:00 , Processed in 0.031790 second(s), 17 queries , Gzip On.

Copyright ©2022 openKylin. All Rights Reserved .

ICP No. 15002470-12 Tianjin

快速回复 返回顶部 返回列表