From faace1bdc213c22f61dfc8b3cb91131f1b225fcd Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Sat, 19 Nov 2022 23:41:17 +0000 Subject: [PATCH] Set GNOME background for both modes :lipstick: Otherwise, the default wallpaper is used for the other mode. Ideally we would support setting two wallpapers and two colourschemes, however that would clash with the other desktop environments which don't have a toggle. Perhaps it's something to think about for the future? --- modules/gnome.nix | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/modules/gnome.nix b/modules/gnome.nix index 783751e..cea3474 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -1,29 +1,25 @@ { pkgs, config, lib, ... }: +with lib; + { options.stylix.targets.gnome.enable = config.lib.stylix.mkEnableTarget "GNOME" true; - config = lib.mkIf config.stylix.targets.gnome.enable { - home-manager.sharedModules = - if config.stylix.polarity == "dark" - then [{ - dconf.settings."org/gnome/desktop/background" = { - color-shading-type = "solid"; - picture-options = "zoom"; - picture-uri-dark = "file://${config.stylix.image}"; - }; - dconf.settings."org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - }; - }] - else [{ - dconf.settings."org/gnome/desktop/background" = { - color-shading-type = "solid"; - picture-options = "zoom"; - picture-uri = "file://${config.stylix.image}"; - }; - }]; + config = mkIf config.stylix.targets.gnome.enable { + home-manager.sharedModules = [{ + dconf.settings."org/gnome/desktop/background" = { + color-shading-type = "solid"; + picture-options = "zoom"; + picture-uri = "file://${config.stylix.image}"; + picture-uri-dark = "file://${config.stylix.image}"; + }; + + dconf.settings."org/gnome/desktop/interface".color-scheme = + if config.stylix.polarity == "dark" + then "prefer-dark" + else "default"; + }]; # As Stylix is controlling the wallpaper, there is no need for this # pack of default wallpapers to be installed.