更改 Ubuntu 20.04 登录主题

更改 Ubuntu 20.04 登录主题

我想使用魔石主题作为我的登录屏幕 (gdm) 主题。我使用了登录用于更改主题的应用程序,我在 arch 上使用过它,效果很好。但它不适用于 ubuntu 20.04。

答案1

从文件中/usr/share/themes/Materia/gnome-shell/README.md..请先阅读警告..如果您希望在理解其中的警告后继续..

按照以下步骤为 gdm 登录欢迎器获取 Materia 主题。

请注意,这只是解决方法之一。还有其他方法。

安装所需的包

sudo apt install libglib2.0-dev-bin

首先备份原有的主题。

sudo cp -av /usr/share/gnome-shell/gnome-shell-theme.gresource{,~}

将目录更改为 Materia 主题

cd /usr/share/themes/Materia/gnome-shell/

创建 gnome-shell.css 的副本作为 gdm3.css

sudo cp gnome-shell.css gdm3.css

编辑文件gnome-shell-theme.gresource.xml以添加行<file>gdm3.css</file>

sudo -H gedit gnome-shell-theme.gresource.xml

<file>gdm3.css</file>注意,我在此行下添加了一行<file>gnome-shell.css</file>

<file>extensions/workspaces-to-dock/workspaces-to-dock.css</file>
<file>gnome-shell.css</file>
<file>gdm3.css</file>
<file>icons/eye-not-looking-symbolic.svg</file>
<file>icons/eye-open-negative-filled-symbolic.svg</file>

保存文件并关闭。

创建所需的“gresource”文件替换原始文件/usr/share/gnome-shell/gnome-shell-theme.gresource

sudo glib-compile-resources --target=/usr/share/gnome-shell/gnome-shell-theme.gresource gnome-shell-theme.gresource.xml

好的,操作已完成。现在使用以下命令告诉 gdm 使用上面操作过的文件作为登录屏幕,并选择与文件相关的数字/usr/share/gnome-shell/gnome-shell-theme.gresource

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

例子:

admin@i7-4770:~$ sudo update-alternatives --config  gdm3-theme.gresource 
[sudo] password for admin: 
There are 2 choices for the alternative gdm3-theme.gresource (providing /usr/share/gnome-shell/gdm3-theme.gresource).

  Selection    Path                                                           Priority   Status
------------------------------------------------------------
  0            /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource   15        auto mode
* 1            /usr/share/gnome-shell/gnome-shell-theme.gresource              10        manual mode
  2            /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource   15        manual mode

Press <enter> to keep the current choice[*], or type selection number: 1
admin@i7-4770:~$ 

重新启动以查看更改..

在此处输入图片描述

在此处输入图片描述

您可以选择更改背景颜色或图像或任何部分。

如果出现错误并且无法看到登录屏幕,请按照 README.md 文件进行操作。


以上仅将登录屏幕主题更改为 Materia。对于锁定屏幕,您需要单独配置。点击此链接如何在 Ubuntu 20.04 中自定义锁屏主题理解这个概念,一旦理解,您可以使用此内容进行正确的配置。

{
    "parentMode": "user",
    "stylesheetName": "gnome-shell.css",
    "themeResourceName": "gnome-shell-theme.gresource",
    "debugFlags": ["backtrace-crashes-all"],
    "enabledExtensions": ["[email protected]", "[email protected]", "desktop-icons@csoriano"]
}

在此处输入图片描述

相关内容