Google Chrome 系统深色模式

The*_*ird 5 themes google-chrome chromium 20.04

当我将 Ubuntu 20.04 切换到黑暗模式时(通过 gnome-tweak-tool > 外观 > Shell > Yaru-dark 和系统应用程序的外观部分)Google Chrome 似乎并不认为我的操作系统/系统偏好是黑暗的主题,正如 chrome 设置部分和轻主题的开发工具所证明的那样。我的开发工具设置为使用基于系统偏好的主题。我知道 enable-force-dark 实验设置存在,但我不希望 chrome 尝试自行将网页转换为深色主题。dconf 或其他地方是否有某种设置会告诉 Google Chrome 以深色主题呈现其内部页面?

小智 4

您必须将 Google Chrome 切换到 GTK 主题(设置 -> 外观 -> 主题)才能使其正常工作。

  • 这不足以让 Chrome 使用网站的深色主题。Linux 中存在一个未解决的问题:https://bugs.chromium.org/p/chromium/issues/detail?id=998903。从 Chrome 94.0 开始,正确设置暗模式的唯一方法是使用“--force-dark-mode”命令行开关。 (17认同)

abu*_*bua 2

您可以使用另一个主题调用 chrome,例如

env GTK_THEME="Yaru-dark" google-chrome --new-window
Run Code Online (Sandbox Code Playgroud)

从你的命令行。

要一致地进行更改,您必须编辑 .desktop 文件:

如果您使用 gnome,请使用其中的桌面文件,~/.local/share/applications/其内容类似于chrome-xxxxxxxx.desktop.

将以 Exec 开头的行更改为:

Exec=env GTK_THEME=Yaru:dark google-chrome %U
Run Code Online (Sandbox Code Playgroud)