抬头仰望星空,是否能发现自己的渺小。

伪斜杠青年

人们总是混淆了欲望和理想

Arch美化之GDM3背景更改

之前就想美化一下manjaro的gdm登录背景,但是谷歌很久无直接解决办法,又由于要考试,便放置一边,现在有时间折腾,便去Arch wiki看了下,教程在此:GDM (简体中文)

既然有教程,干嘛还要写博文记录呢? 这个问题,你自己去看看Log-in screen background image一栏。。你就知道了

原文如下:

我记录这篇文章只是为了方便我自己下次操作,高手略过

登录背景的设置

注意:从GNOME3.16开始,GNOME Shell themes存放在二进制文件中

首先,你需要释放存在的shell主题到你的home目录中,新建一个脚本extractgst.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

当你成功执行后,你会发现你的home目录下有一个shell-theme文件夹,里面的theme中会有一些文件,把想设置的背景图片放到这个文件夹中,接下来你需要创建一个文件gnome-shell-theme.gresource.xml

内容如下:

/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>

替换中间的filename为你的背景图片名字,我的是back.jpg

所以改为<file>back.jpg<file>,保存,然后,打开目录中的gnome-shell.css,

Ctrl+F找到#lockDialogGroup

修改为:

#lockDialogGroup {
 background: #2e3436 url(filename); 
 background-size: [WIDTH]px [HEIGHT]px; 
 background-repeat: no-repeat;
 }

我更改后为:

#lockDialogGroup {
 background: #2e3436 url(back.jpg);
 background-size: 1366px 768px;
 background-repeat: no-repeat;
}

filename为你的背景图名称

background-size为你的分辨率的宽高

最后在当前打开终端目录执行以下命令:

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

会生成一个文件gnome-shell-theme.gresource

然后复制到/usr/share/gnome-shell

sudo cp -R gnome-shell-theme.gresource /usr/share/gnome-shell

重启GDM即可看到效果;


本站由以下主机服务商提供服务支持:

2条评论

  • wind

    最后在当前打开终端目录执行以下命令:

    $ glib-compile-resources gnome-shell-theme.gresource.xml
    但是显示 gnome-shell-theme.gresource.xml: Failed to locate “calendar-arrow-left.svg” in current directory ~
    把calendar-arrow-left.svg从xml文件删掉还是会显示Failed to locate “xxx” in current directory

    • Mosaic-C

      现在是2910年,我想可能发生了什么变化,我已很久没在折腾了,建议你翻翻上面的wiki,按wiki指引操作试试。

发表评论