feat(gtk): add cursor theming support (#61)

This commit is contained in:
Leah Amelia Chen 2023-11-05 00:46:21 +01:00 committed by GitHub
parent 714c415506
commit f3aaec142f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 20 deletions

View file

@ -23,26 +23,43 @@ in
default = [ "normal" ];
description = "Catppuccin tweaks for gtk";
};
};
config.gtk.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;
cursor = ctp.mkCatppuccinOpt "gtk cursors"
// {
accent = ctp.mkAccentOpt "gtk cursors";
};
};
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
{
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};
};
};
}

View file

@ -69,7 +69,11 @@ in
zathura = ctpEnable;
};
gtk = ctpEnable;
gtk =
ctpEnable
// {
catppuccin.cursor.enable = true;
};
services = {
mako = ctpEnable;