AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1179263
Accepted
Sun Bear
Sun Bear
Asked: 2019-10-08 02:01:39 +0800 CST2019-10-08 02:01:39 +0800 CST 2019-10-08 02:01:39 +0800 CST

安装自定义 GDM 主题:替换 ubuntu.css 与使用“update-alternatives --install .... gdm3.css”

  • 772

我通过 2 种方法为 Ubuntu 18.04 的 GDM 安装了一个自定义的 css 文件。令人惊讶的是,他们给出了不同的结果:

方法(A)

  1. 我将自定义的 GDM css 文件保存为 /usr/share/gnome-shell/theme/ubuntu.css. 也就是说,我已经用我自己的 .css 文件替换了原来的 ubuntu.css 文件,但给了新文件与 ubuntu.css 相同的名称。
  2. 我按 Alt+F2然后按r+Return重新启动 GDM。
  3. 接下来,我按下Super+L来锁定我的桌面。从那里,我首先能够看到 gnome-tweaks 为锁屏设置的壁纸。锁屏的小部件样式遵循我自定义的 css 文件。接下来,对于解锁屏幕,它的壁纸和小部件样式遵循我自定义的 css 文件。
  4. 要在登录屏幕上查看自定义 css 文件的结果,我必须重新启动系统或从当前会话中注销。

方法 (B)

1 我使用了这些命令:

$ sudo update-alternatives --auto gdm3.css
$ sudo update-alternatives --install /usr/share/gnome-shell/theme/gdm3.css gdm3.css /usr/share/gnome-shell/theme/mytheme/mytheme.css 11
update-alternatives: using /usr/share/gnome-shell/theme/mytheme/mytheme.css to provide /usr/share/gnome-shell/theme/gdm3.css (gdm3.css) in auto mode
$ sudo update-alternatives --config gdm3.css
There are 2 choices for the alternative gdm3.css (providing /usr/share/gnome-shell/theme/gdm3.css).

  Selection    Path                                                    Priority   Status
------------------------------------------------------------
* 0            /usr/share/gnome-shell/theme/mytheme/mytheme.css   11        auto mode
  1            /usr/share/gnome-shell/theme/mytheme/mytheme.css   11        manual mode
  2            /usr/share/gnome-shell/theme/ubuntu.css            10        manual mode

Press <enter> to keep the current choice[*], or type selection number: 
  1. 我按Alt+F2然后按r+Return重新启动 GDM。
  2. 接下来,我按下Super+L来锁定我的桌面。与方法 A 不同,我无法在解锁屏幕中看到自定义 css 文件中定义的壁纸和样式;这是一个紫色的屏幕,出现了通常的 ubuntu 解锁小部件。对于锁屏(即屏幕保护程序),它显示了 gnome-tweaks 设置的壁纸,但它的小部件样式不符合我自定义的 css 文件。
  3. 为了查看我自定义的 css 文件的效果是否会出现在登录屏幕中,我重新启动了系统。我很高兴在登录屏幕中找到自定义 ccs 中定义的壁纸和样式。但是,登录后,按Super+L锁定我的桌面后,3.中描述的问题仍然存在。

你能解释一下为什么方法 B 和方法 A 会产生不同的最终产品吗?特别是,为什么我的自定义 css 文件中定义的样式和壁纸没有出现在解锁屏幕中,并且我自定义的 css 文件中定义的小部件样式没有出现在方法 B 的锁屏中?

gnome gdm gnome-shell 18.04 update-alternatives
  • 1 1 个回答
  • 1976 Views

1 个回答

  • Voted
  1. Best Answer
    UnKNOWn
    2019-10-08T08:51:12+08:002019-10-08T08:51:12+08:00

    在全新安装的 Ubuntu 18.04 中,

    如果你观察文件/usr/share/gnome-shell/modes/ubuntu.json

    {
        "parentMode": "user",
        "stylesheetName": "ubuntu.css",
        "enabledExtensions": ["[email protected]", "[email protected]"]
    }
    

    该行stylesheeName: ubuntu.css表示 default-shell 主题(即当没有安装用户主题 gnome-shell-extension 时)使用主题文件/usr/share/gnome-shell/theme/ubuntu.css

    以及您将在此文件中拥有的背景,用于unlock-screen background

    因此,当您使用“方法 B”时,您需要像这样编辑该行:sylesheetName: "mytheme/mytheme.css",

    • 1

相关问题

  • 为什么我的时钟、指示器小程序和通知区域有时会在我重新启动时移动?我怎样才能防止这种情况?

  • 停止菜单图标闪烁

  • 如何更改 GDM 中的登录屏幕主题?

  • 是否有适用于 IMAP 邮件帐户的 Gnome 小程序?

  • 如果顶部面板中缺少会话小程序,如何注销?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve