Set GNOME background for both modes 💄

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?
This commit is contained in:
Daniel Thwaites 2022-11-19 23:41:17 +00:00
parent 921ff2a2bb
commit faace1bdc2
No known key found for this signature in database
GPG key ID: D8AFC4BF05670F9D

View file

@ -1,29 +1,25 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
with lib;
{ {
options.stylix.targets.gnome.enable = options.stylix.targets.gnome.enable =
config.lib.stylix.mkEnableTarget "GNOME" true; config.lib.stylix.mkEnableTarget "GNOME" true;
config = lib.mkIf config.stylix.targets.gnome.enable { config = mkIf config.stylix.targets.gnome.enable {
home-manager.sharedModules = home-manager.sharedModules = [{
if config.stylix.polarity == "dark" dconf.settings."org/gnome/desktop/background" = {
then [{ color-shading-type = "solid";
dconf.settings."org/gnome/desktop/background" = { picture-options = "zoom";
color-shading-type = "solid"; picture-uri = "file://${config.stylix.image}";
picture-options = "zoom"; picture-uri-dark = "file://${config.stylix.image}";
picture-uri-dark = "file://${config.stylix.image}"; };
};
dconf.settings."org/gnome/desktop/interface" = { dconf.settings."org/gnome/desktop/interface".color-scheme =
color-scheme = "prefer-dark"; if config.stylix.polarity == "dark"
}; then "prefer-dark"
}] else "default";
else [{ }];
dconf.settings."org/gnome/desktop/background" = {
color-shading-type = "solid";
picture-options = "zoom";
picture-uri = "file://${config.stylix.image}";
};
}];
# As Stylix is controlling the wallpaper, there is no need for this # As Stylix is controlling the wallpaper, there is no need for this
# pack of default wallpapers to be installed. # pack of default wallpapers to be installed.