Skip to content

Commit

Permalink
regreet: respect dark mode and do not set extraCss
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mikilio committed Jan 7, 2025
1 parent a4ed416 commit 186a69e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions modules/regreet/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,10 +52,6 @@
package = pkgs.adw-gtk3;
name = "adw-gtk3";
};
extraCss = config.lib.stylix.colors {
template = ./../gtk/gtk.mustache;
extension = "css";
};
};
};
}

0 comments on commit 186a69e

Please sign in to comment.