From cfea36f08b81443811cc3a5bdab2e67c857d939b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 4 Jun 2024 14:24:13 +0100 Subject: [PATCH] Make more theme parts dynamic Pick Light vs Dark GTK theme based on variant name Pick correct theme for bat Team: stop following system theme --- home/default.nix | 13 +++++++++---- home/work.nix | 2 +- programs/shell/default.nix | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/home/default.nix b/home/default.nix index 53cd905..b0a78ba 100644 --- a/home/default.nix +++ b/home/default.nix @@ -2,6 +2,7 @@ config, lib, pkgs, + catppuccinVariant ? "Mocha", ... }: { imports = [ @@ -36,7 +37,11 @@ }; gtk = with lib.strings; let accent = "Lavender"; - variant = "Mocha"; + variant = catppuccinVariant; + type = + if variant == "Latte" + then "Light" + else "Dark"; in { enable = true; iconTheme = { @@ -47,8 +52,8 @@ name = "Papirus-Dark"; }; cursorTheme = { - package = pkgs.catppuccin-cursors."${toLower variant}Dark"; - name = "Catppuccin-${variant}-Dark-Cursors"; + package = pkgs.catppuccin-cursors."${toLower variant}${type}"; + name = "Catppuccin-${variant}-${type}-Cursors"; size = 32; }; theme = let @@ -59,7 +64,7 @@ size = toLower size; variant = toLower variant; }; - name = "Catppuccin-${variant}-${size}-${accent}-Dark"; + name = "Catppuccin-${variant}-${size}-${accent}-${type}"; }; }; xdg = { diff --git a/home/work.nix b/home/work.nix index f4d3fa4..4eee7e2 100644 --- a/home/work.nix +++ b/home/work.nix @@ -22,7 +22,7 @@ awayOnSystemIdle = true; closeAppOnCross = true; electronCLIFlags = lib.mkIf config.wayland.windowManager.sway.enable [["ozone-platform" "wayland"]]; - followSystemTheme = true; + followSystemTheme = false; notificationMethod = "electron"; optInTeamsV2 = true; spellCheckerLanguages = ["en_GB"]; diff --git a/programs/shell/default.nix b/programs/shell/default.nix index 2bdbbb0..dbf715d 100644 --- a/programs/shell/default.nix +++ b/programs/shell/default.nix @@ -1,6 +1,7 @@ { lib, pkgs, + catppuccinVariant ? "Mocha", ... }: { imports = [ @@ -26,7 +27,7 @@ bat = { enable = true; config = { - theme = "catppuccinMocha"; + theme = "catppuccin${catppuccinVariant}"; style = "plain,numbers,changes"; }; };