added preferDark option to theme module

This commit is contained in:
Aly Raffauf 2024-05-08 11:37:38 -04:00
parent 5c57279f73
commit 5f79d20279
3 changed files with 10 additions and 5 deletions

View file

@ -28,8 +28,8 @@
"update.mode" = "none";
"window.menuBarVisibility" = "hidden";
"window.zoomPerWindow" = false;
"workbench.colorTheme" = "Catppuccin Macchiato";
"workbench.iconTheme" = "catppuccin-macchiato";
"workbench.colorTheme" = if config.alyraffauf.desktop.theme.colors.preferDark then "Catppuccin Macchiato" else "Catppuccin Latte";
"workbench.iconTheme" = if config.alyraffauf.desktop.theme.colors.preferDark then "catppuccin-macchiato" else "catppuccin-latte";
"workbench.preferredDarkColorTheme" = "Catppuccin Macchiato";
"workbench.preferredLightColorTheme" = "Catppuccin Latte";
};

View file

@ -88,7 +88,7 @@
#clock,
#hardware {
border-radius: 10;
background: rgba (35, 38, 52, 0.8);
background: rgba ${if config.alyraffauf.desktop.theme.colors.preferDark then "(35, 38, 52, 0.8);" else "(220, 224, 232, 0.8);"}
margin: 5px 10px 0px 10px;
padding: 0px 10px 0px 10px;
}

View file

@ -91,6 +91,11 @@
};
};
alyraffauf.desktop.theme.colors = {
preferDark = lib.mkOption {
description = "Whether to prefer dark mode apps or not.";
default = true;
type = lib.types.bool;
};
text = lib.mkOption {
description = "Text color.";
default = "#FAFAFA";
@ -163,9 +168,9 @@
size = config.alyraffauf.desktop.theme.font.size;
};
gtk3.extraConfig = {gtk-application-prefer-dark-theme = 1;};
gtk3.extraConfig = lib.attrsets.optionalAttrs (config.alyraffauf.desktop.theme.colors.preferDark) {gtk-application-prefer-dark-theme = 1;};
gtk4.extraConfig = {gtk-application-prefer-dark-theme = 1;};
gtk4.extraConfig = lib.attrsets.optionalAttrs (config.alyraffauf.desktop.theme.colors.preferDark) {gtk-application-prefer-dark-theme = 1;};
};
dconf.settings = {