Gnome3提取gnome-shell.css以及修改和编译

来源:互联网 发布:淘宝全球购假货多吗 编辑:程序博客网 时间:2024/06/03 22:08

原帖:http://hack.fdzh.org/item?id=522

GNOME 3.12 开始使用 GResource 二进制资源文件保存 js/css/svg 等文件,需使用 gresource 解压,使用 glib-compile-resources 封装。
将下面的代码保存为一个sh脚本文件:

#!/bin/shgs="/usr/share/gnome-shell/gnome-shell-theme.gresource"for r in `gresource list $gs`; do    gresource extract $gs $r > ${r/#\/org\/gnome\/shell\/theme/.}done

运行这个脚本文件就会在当前目录下生成gnome-shell-theme.gresource中编译打包过了的资源文件,其中就有gnome-shell.css
接着按你所需编辑gnome-shell.css文件后,在终端执行以下命令:

//这是是下载gnome-shell-theme.gresource.xml资源规格文件到当前目录wget https://raw.githubusercontent.com/GNOME/gnome-shell/master/data/gnome-shell-theme.gresource.xml

接着执行编译命令来生成资源文件:

glib-compile-resources gnome-shell-theme.gresource.xml

执行完毕后就回在当前目录生成gnome-shell-theme.gresource文件了。
将生成的gnome-shell-theme.gresource 覆盖系统默认的 /usr/share/gnome-shell/gnome-shell-theme.gresource 即可。

下面是隐藏标题栏的两个方法:
方法1(arch是这样),创建 ~/.config/gtk-3.0/gtk.css 文件:

.header-bar.default-decoration {  padding-top: 3px;  padding-bottom: 3px;}.header-bar.default-decoration .button.titlebutton {  padding-top: 2px;  padding-bottom: 2px;}

然后重启Shell

方法2,安装插件 https://extensions.gnome.org/extension/844/maximus-two/

打开 ~/user/share/gnome-shell/extensions/maximus-two\@wilfinitlike.gmail.com/metadata.json 文件增加:

3.14

+3.16

0 0