From 186a69eaa6305f9bbebeb893f19621ae14066a09 Mon Sep 17 00:00:00 2001 From: Mikilio Date: Mon, 6 Jan 2025 06:52:15 +0100 Subject: [PATCH] regreet: respect dark mode and do not set extraCss ReGreet will choose dark colors from the GTK theme if we instruct it to do so. ReGreet uses the global GTK theme if the environment is set the default Nixpkgs configuration takes care of that so extraCss will be left free for actual user overrides. --- modules/regreet/nixos.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/regreet/nixos.nix b/modules/regreet/nixos.nix index 3b610c6b6..d586c5d4e 100644 --- a/modules/regreet/nixos.nix +++ b/modules/regreet/nixos.nix @@ -12,7 +12,22 @@ lib.mkIf (config.stylix.enable && config.stylix.targets.regreet.enable && pkgs.stdenv.hostPlatform.isLinux) { + warnings = + let + cfg = config.programs.regreet; + in + lib.mkIf + ( + cfg.enable + && + !config.services.greetd.settings.default_session.command + == "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} ${lib.escapeShellArgs cfg.cageArgs} -- ${lib.getExe cfg.package}" + ) + [ + "Stylix is not guaranteed to style regreet correctly when setting a custom command in `services.greetd.settings.default_session.command `. Note that in most cases no variables under `services.greetd` need to be manually set to ensure that ReGreet is functional" + ]; programs.regreet = { + settings.GTK.application_prefer_dark_theme = config.stylix.polarity == "dark"; settings.background = { path = config.stylix.image; fit = let @@ -37,10 +52,6 @@ package = pkgs.adw-gtk3; name = "adw-gtk3"; }; - extraCss = config.lib.stylix.colors { - template = ./../gtk/gtk.mustache; - extension = "css"; - }; }; }; }