diff options
| author | Henry J. Webster <hwebs@hwebs.info> | 2026-07-30 18:49:53 -0500 |
|---|---|---|
| committer | Henry J. Webster <hwebs@hwebs.info> | 2026-07-30 18:49:53 -0500 |
| commit | ddd8f283326c65972d17eb1016e19539a6fac70e (patch) | |
| tree | 016f0965ba897cf2dc8a4c2a8796ac7ba232a59c | |
| parent | e9be3a6a753c09af64ef0f94481d5faa03bcef66 (diff) | |
enzo: serve portal color-scheme from gtk backend so web content goes dark
LibreWolf chrome was dark (via GTK theme) but web content stayed light. Root
cause is the portal, not the browser: the niri module routes the Settings
interface to xdg-desktop-portal-gnome, whose color-scheme depends on
gnome-settings-daemon. Under bare niri (no GNOME session) gsd is absent, so the
portal reported "no preference" and content's prefers-color-scheme resolved
light.
Pin org.freedesktop.impl.portal.Settings to the gtk backend, which reads the
org.gnome.desktop.interface color-scheme dconf key directly (no gsd), and add
xdg-desktop-portal-gtk. The key merges into the niri module's
xdg.portal.config.niri. Now the portal reports prefer-dark and content follows.
Assisted-by: Claude:claude-opus-4-8
| -rw-r--r-- | machines/enzo/desktop.nix | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/machines/enzo/desktop.nix b/machines/enzo/desktop.nix index 9d543fb..4d1c29b 100644 --- a/machines/enzo/desktop.nix +++ b/machines/enzo/desktop.nix @@ -8,17 +8,28 @@ programs.niri.enable = true; programs.dconf.enable = true; - # Tell the desktop it's in dark mode. niri has no settings daemon; apps learn - # light/dark from xdg-desktop-portal's Settings interface, whose gnome/gtk - # backends read this dconf key. Setting it here makes the portal report - # "prefer-dark", so Firefox/LibreWolf (Auto theme + web content) and GTK apps - # all go dark — no per-app theme config needed. + # Tell the desktop it's in dark mode. Apps read light/dark from + # xdg-desktop-portal's Settings interface (org.freedesktop.appearance + # color-scheme). This dconf default is the value the portal serves. programs.dconf.profiles.user.databases = [ { settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; } ]; + # Serve color-scheme from the *gtk* portal backend, not gnome. The niri module + # routes Settings to xdg-desktop-portal-gnome (its default), but that backend + # relies on gnome-settings-daemon — absent under bare niri — so it reports + # "no preference" and web content (LibreWolf's prefers-color-scheme) stays + # light even though GTK chrome follows the dark GTK theme. xdg-desktop-portal- + # gtk reads the dconf color-scheme above directly, so pinning Settings to it + # makes the portal actually report dark and content follows. This key merges + # into the niri module's xdg.portal.config.niri. + xdg.portal = { + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + config.niri."org.freedesktop.impl.portal.Settings" = "gtk"; + }; + services.greetd = { enable = true; settings.default_session = { |
