Skip to content

Commit

Permalink
feat(gtk): add cursor theming support (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
pluiedev authored Nov 4, 2023
1 parent 714c415 commit f3aaec1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 19 deletions.
53 changes: 35 additions & 18 deletions modules/home-manager/gtk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,43 @@ in
default = [ "normal" ];
description = "Catppuccin tweaks for gtk";
};

cursor = ctp.mkCatppuccinOpt "gtk cursors"
// {
accent = ctp.mkAccentOpt "gtk cursors";
};
};

config.gtk.theme =
let
flavourUpper = ctp.mkUpper cfg.flavour;
accentUpper = ctp.mkUpper cfg.accent;
sizeUpper = ctp.mkUpper cfg.size;
config.gtk = lib.mkIf enable {
theme =
let
flavourUpper = ctp.mkUpper cfg.flavour;
accentUpper = ctp.mkUpper cfg.accent;
sizeUpper = ctp.mkUpper cfg.size;

# use the light gtk theme for latte
gtkTheme =
if cfg.flavour == "latte"
then "Light"
else "Dark";
in
lib.mkIf enable {
name = "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}";
package = pkgs.catppuccin-gtk.override {
inherit (cfg) size tweaks;
accents = [ cfg.accent ];
variant = cfg.flavour;
# use the light gtk theme for latte
gtkTheme =
if cfg.flavour == "latte"
then "Light"
else "Dark";
in
{
name = "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}";
package = pkgs.catppuccin-gtk.override {
inherit (cfg) size tweaks;
accents = [ cfg.accent ];
variant = cfg.flavour;
};
};
};

cursorTheme =
let
flavourUpper = ctp.mkUpper cfg.cursor.flavour;
accentUpper = ctp.mkUpper cfg.cursor.accent;
in
lib.mkIf cfg.cursor.enable {
name = "Catppuccin-${flavourUpper}-${accentUpper}";
package = pkgs.catppuccin-cursors.${cfg.cursor.flavour + accentUpper};
};
};
}
6 changes: 5 additions & 1 deletion test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ in
zathura = ctpEnable;
};

gtk = ctpEnable;
gtk =
ctpEnable
// {
catppuccin.cursor.enable = true;
};

services = {
mako = ctpEnable;
Expand Down

0 comments on commit f3aaec1

Please sign in to comment.