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, ... }:
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.