答案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"]
}