我正在尝试将 nautilus 设置为黑暗模式,但没有成功。
我试过:
- 运行这个命令:
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
- 设置配色方案
~/.config/gtk-4.0/gtk.css
@import url("resource:///org/gtk/libadwaita/ado.css");
AdwStyleContext {
color-scheme: dark;
}
- 将其设置为
~/.config/gtk-4.0/settings.ini
[Settings]
gtk-enable-animations=true
gtk-icon-theme-name=Adwaita-dark
gtk-application-prefer-dark-theme=0
但这没有任何效果并会删除此警告:
(org.gnome.Nautilus:69565): Adwaita-WARNING **: 23:24:29.934:
Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported.
Please use AdwStyleManager:color-scheme instead.
我应该如何为我的系统上的 gtk4 应用程序设置全局暗模式?
附加信息:我使用的是Arch linux + wayland + sway
我正在使用莱显示管理器。我以 systemd 服务启动:
● ly.service - TUI display manager
Loaded: loaded (/usr/lib/systemd/system/ly.service; enabled; preset: disabled)
Active: active (running) since Wed 2024-01-03 10:31:36 CET; 3h 52min ago
Main PID: 1042 (ly-dm)
Tasks: 0 (limit: 8734)
Memory: 2.5M (peak: 5.0M)
CPU: 39ms
CGroup: /system.slice/ly.service
‣ 1042 /usr/bin/ly-dm
答案1
添加
GTK_THEME=Adwaita-dark
到/etc/environment
。