1. 保存下面的文件为theme.sh, 然后执行 sh theme.sh
#!/bin/sh
workdir=${HOME}/shell-theme
if [ ! -d ${workdir}/theme ]; then
mkdir -p ${workdir}/theme
fi
gst=/usr/share/gnome-shell/gnome-shell-theme.gresource
for r in `gresource list $gst`; do
gresource extract $gst $r >$workdir${r/#\/org\/gnome\/shell/}
done
2. 进入shell-theme文件夹,此时你会看到你解压出来的文件,通过名字我们也可以知道某个文件事干什么的
接下来你需要建立一个gnome-shell-theme.gresource.xml文件,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/shell/theme">
<file>calendar-arrow-left.svg</file>
<file>calendar-arrow-right.svg</file>
<file>calendar-today.svg</file>
<file>checkbox-focused.svg</file>
<file>checkbox-off-focused.svg</file>
<file>checkbox-off.svg</file>
<file>checkbox.svg</file>
<file>close-window.svg</file>
<file>close.svg</file>
<file>corner-ripple-ltr.png</file>
<file>corner-ripple-rtl.png</file>
<file>dash-placeholder.svg</file>
<file>filter-selected-ltr.svg</file>
<file>filter-selected-rtl.svg</file>
<file>gnome-shell.css</file>
<file>gnome-shell-high-contrast.css</file>
<file>logged-in-indicator.svg</file>
<file>filename</file>
<file>more-results.svg</file>
<file>no-events.svg</file>
<file>no-notifications.svg</file>
<file>noise-texture.png</file>
<file>page-indicator-active.svg</file>
<file>page-indicator-inactive.svg</file>
<file>page-indicator-checked.svg</file>
<file>page-indicator-hover.svg</file>
<file>process-working.svg</file>
<file>running-indicator.svg</file>
<file>source-button-border.svg</file>
<file>summary-counter.svg</file>
<file>toggle-off-us.svg</file>
<file>toggle-off-intl.svg</file>
<file>toggle-on-us.svg</file>
<file>toggle-on-intl.svg</file>
<file>ws-switch-arrow-up.png</file>
<file>ws-switch-arrow-down.png</file>
</gresource>
</gresources>
** 注意: xml文件里面有一个filename,markdown不好标注,那里要改成你自己的背景图片的名称**
3. 打开gnome-shell.css,找到#lockDialogGroup
修改如下
#lockDialogGroup {
background: #2e3436 url(filename);
background-size: [WIDTH]px [HEIGHT]px;
background-repeat: no-repeat;
}
4. 最后重新编译gresource文件,通过如下命令
glib-compile-resources gnome-shell-theme.gresource.xml
然后将生成的gnome-shell-theme.gresource
文件复制到/usr/share/gnome-shell
,替换原有的gresource文件即可,来张效果图:
<br>