我如何更改 GDM 登录屏幕壁纸?

我如何更改 GDM 登录屏幕壁纸?

我如何更改 GDM 3.6 壁纸?我不是指桌面背景,而是登录时的壁纸(GDM 3.6)。

谢谢


谢谢您的回答,

我完全明白你的意思。最近我安装了 LightDm,但今天我卸载了它,并用 GDM 替换了它。Ubuntu-Tweak 不显示登录屏幕外观按钮。我认为这是因为 LightDM 目前尚未安装。有人知道存储图像的文件夹在哪里吗?

答案1

另外值得一提的是,使用 Ubuntu Artful 17.10,你可以使用以下方法恢复到默认的 Gnome 3 主题体验:

sudo update-alternatives --config gdm3.css

并选择默认gnome-shell.css选项。

来源:https://didrocks.fr/2017/09/11/ubuntu-gnome-shell-in-artful-day-11/

其他 Ubuntu 和 Debian 版本

Debian 和 Ubuntu 中的系统alternatives 依靠“链接组”名称来配置具有类似功能的软件或文件。/etc/alternatives/文件系统中的通用名称由提供可互换功能的不同软件包中包含的所有文件共享。

请注意,即使对于同一款软件,此“链接组”名称也可能不同,具体取决于您正在使用的 Ubuntu 或 Debian 版本。要查看系统上可用的链接组,请运行:

update-alternatives --get-selections

对于这个特定的示例gdm3,您可能希望将其过滤为仅与gdm相关的名称:

update-alternatives --get-selections`  | grep -i gdm

# Returns the following on Ubuntu 20.04 LTS
# gdm3-theme.gresource           auto     /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource

要配置此链接组名称,只需将其传递给update-alternatives --config $LINK_GROUP_NAME_HERE(例如):

sudo update-alternatives --config gdm3-theme.gresource

答案2

  1. 将要使用的图像复制到/usr/share/gnome-shell/theme文件夹中

    sudo gedit /usr/share/gnome-shell/theme/gnome-shell.css
    
  2. 搜索以下部分

    #lockDialogGroup {
    background: #2e3436 url(noise-texture.png);
    background-repeat: no-repeat;
    
  3. 将图片名称更改为您的图片

  4. 背景重复或者不重复

  5. 保存文件

注销后你的新背景就出现了

答案3

按照 Arch Linux Wiki 上的说明进行操作:

https://wiki.archlinux.org/index.php/GDM#Log-in_screen_background_image

您需要执行以下操作:

1. 提取 gnome-shell-theme 二进制文件

创建并运行以下脚本(/usr/local/bin/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

2. 编辑 gnome-shell-theme.gresource.xml 和 gnome-shell.css(部分#lockDialogGroup

这将创建目录$HOME/shell-theme/theme。将目录更改为此位置。

然后创建文件gnome-shell-theme.gresource.xml在上面的目录中。

有了以下内容,图像文件名必须替换为您的文件名背景图

<?xml version="1.0" encoding="UTF-8"?>
<gresources>
  <gresource prefix="/org/gnome/shell/theme">

    <file>imagefilename</file>

    <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>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-hc.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>

现在,打开gnome-shell.css-目录中的文件并更改#lockDialogGroup 定义如下:

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

设置background-size为 GDM 使用的分辨率,这可能不一定是图像的分辨率。

3.然后再次编译

最后,使用以下命令编译主题:

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

4.复制编译好的gnome-shell-theme文件

并将生成的gnome-shell-theme.gresource文件复制到/usr/share/gnome-shell目录中。

5. 重新启动 gdm 或注销

最后重新启动 gdm 或者直接注销。

完成的!

答案4

sudo machinectl shell gdm@ `which gsettings` \
  set com.ubuntu.login-screen background-picture-uri /path/to/greeter.jpg

您需要匹配屏幕尺寸。例如,如果您有 2 个 2k 屏幕,则图像需要为 5120x1440。

您还可以设置颜色,如果图像没有覆盖整个屏幕,颜色也会填充图像周围。

sudo machinectl shell gdm@ `which gsettings` \
  set com.ubuntu.login-screen background-color '#9c0031'

还有其他 2 个键background-repeat,我假设它们对应css 值,还没有检查。background-size这需要:

  • 自动 - 原始图像大小
  • cover - 缩放至覆盖并裁剪额外内容
  • 包含 - 拉伸以适应

相关内容