diff --git a/bin/nomarchy-theme-set-gnome b/bin/nomarchy-theme-set-gnome deleted file mode 100755 index 9ead915..0000000 --- a/bin/nomarchy-theme-set-gnome +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Change gnome modes -if [[ -f ~/.config/nomarchy/current/theme/light.mode ]]; then - gsettings set org.gnome.desktop.interface color-scheme "prefer-light" - gsettings set org.gnome.desktop.interface gtk-theme "Adwaita" -else - gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" - gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" -fi - -# Change gnome icon theme color -GNOME_ICONS_THEME=~/.config/nomarchy/current/theme/icons.theme -if [[ -f $GNOME_ICONS_THEME ]]; then - gsettings set org.gnome.desktop.interface icon-theme "$(<$GNOME_ICONS_THEME)" -else - gsettings set org.gnome.desktop.interface icon-theme "Yaru-blue" -fi diff --git a/modules/home/default.nix b/modules/home/default.nix index 6a50454..ba98bef 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -49,6 +49,8 @@ in mise jq xmlstarlet + yaru-theme + bibata-cursors nerd-fonts.jetbrains-mono nerd-fonts.roboto-mono nerd-fonts.fira-code diff --git a/modules/home/options.nix b/modules/home/options.nix index 0243d87..a9b6545 100644 --- a/modules/home/options.nix +++ b/modules/home/options.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ lib, pkgs, ... }: { options.nomarchy = { @@ -73,6 +73,28 @@ description = "System monospace font."; }; }; + iconsTheme = lib.mkOption { + type = lib.types.str; + default = "Yaru-blue"; + description = "System icon theme name."; + }; + isLightMode = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Whether the current theme is light mode."; + }; + cursor = { + name = lib.mkOption { + type = lib.types.str; + default = "Bibata-Modern-Ice"; + description = "Mouse cursor theme name."; + }; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.bibata-cursors; + description = "Package providing the cursor theme."; + }; + }; configOverrides = lib.mkOption { type = lib.types.nullOr lib.types.path; default = null; diff --git a/modules/home/state.nix b/modules/home/state.nix index 31b0861..3c630f1 100644 --- a/modules/home/state.nix +++ b/modules/home/state.nix @@ -117,6 +117,15 @@ in border_size = togglesState.hyprland.border_size or 2; }; fonts.monospace = togglesState.font or "JetBrainsMono Nerd Font"; + + # Derived properties from the theme directory + isLightMode = builtins.pathExists (../../themes + "/${togglesState.theme or "nord"}/light.mode"); + iconsTheme = let + iconsFile = ../../themes + "/${togglesState.theme or "nord"}/icons.theme"; + in + if builtins.pathExists iconsFile + then lib.removeSuffix "\n" (builtins.readFile iconsFile) + else "Yaru-blue"; }; }; } diff --git a/modules/home/stylix.nix b/modules/home/stylix.nix index f8f1acc..e3c0878 100644 --- a/modules/home/stylix.nix +++ b/modules/home/stylix.nix @@ -21,12 +21,12 @@ in image = activeWallpaper; base16Scheme = currentPalette; - # Force dark/light mode based on theme name if possible, or just default to dark - polarity = if lib.strings.hasInfix "light" activeThemeName then "light" else "dark"; + # Use detected light mode state + polarity = if config.nomarchy.isLightMode then "light" else "dark"; cursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Ice"; + package = config.nomarchy.cursor.package; + name = config.nomarchy.cursor.name; size = 24; }; @@ -65,4 +65,13 @@ in gnome.enable = true; }; }; + + # GTK Icon Theme configuration + gtk = { + enable = true; + iconTheme = { + package = pkgs.yaru-theme; + name = config.nomarchy.iconsTheme; + }; + }; }