From 2b2569b813aeb099f6c5b2102174e9c5a7c57e59 Mon Sep 17 00:00:00 2001 From: isabel Date: Mon, 10 Jun 2024 22:16:27 +0100 Subject: [PATCH] feat(home-manager): set hyprcursor --- modules/home-manager/hyprland.nix | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index 9f4e2499..3c8acd97 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -3,19 +3,34 @@ let inherit (config.catppuccin) sources; cfg = config.wayland.windowManager.hyprland.catppuccin; enable = cfg.enable && config.wayland.windowManager.hyprland.enable; + inherit (config.gtk.catppuccin) cursor; in { options.wayland.windowManager.hyprland.catppuccin = lib.ctp.mkCatppuccinOpt "hyprland" // { accent = lib.ctp.mkAccentOpt "hyprland"; }; - config.wayland.windowManager.hyprland.settings = lib.mkIf enable { - source = [ - "${sources.hyprland}/themes/${cfg.flavor}.conf" - (builtins.toFile "hyprland-${cfg.accent}-accent.conf" '' - $accent=''$${cfg.accent} - $accentAlpha=''$${cfg.accent}Alpha - '') - ]; + config = lib.mkIf enable { + home.sessionVariables = lib.mkIf cursor.enable { + HYPRCURSOR_SIZE = "24"; + HYPRCURSOR_THEME = "catppuccin-${cursor.flavor}-${cursor.accent}-cursors"; + }; + + wayland.windowManager.hyprland.settings = { + source = + [ + "${sources.hyprland}/themes/${cfg.flavor}.conf" + (builtins.toFile "hyprland-${cfg.accent}-accent.conf" '' + $accent=''$${cfg.accent} + $accentAlpha=''$${cfg.accent}Alpha + '') + ] + ++ lib.optionals cursor.enable [ + (builtins.toFile "hyprland-cursors.conf" '' + env = HYPRCURSOR_THEME,MyCursor + env = HYPRCURSOR_SIZE,24 + '') + ]; + }; }; }