Skip to content

Commit

Permalink
feat(home-manager): set hyprcursor (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses authored Jun 10, 2024
1 parent 85558d1 commit e55fb42
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions modules/home-manager/hyprland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'')
];
};
};
}

0 comments on commit e55fb42

Please sign in to comment.