From 7772bb6b67addcbe13d835fc257336476690c99c Mon Sep 17 00:00:00 2001 From: Sean Kovacs Date: Sun, 14 Dec 2025 10:13:58 -0500 Subject: [PATCH] fix cursors --- home/all.nix | 49 ++++++++++++++++++++++++++++++++++++--- home/systemd/default.nix | 13 ++++++++++- home/tiling/niri/niri.nix | 6 +++-- 3 files changed, 62 insertions(+), 6 deletions(-) diff --git a/home/all.nix b/home/all.nix index 4eedcc3..9aa1f06 100755 --- a/home/all.nix +++ b/home/all.nix @@ -72,6 +72,32 @@ default = 10; }; }; + cursor = + let + attrName = config.catppuccin.flavor + config.catppuccinUpper.accent; + in + { + name = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "catppuccin-${config.catppuccin.flavor}-${config.catppuccin.accent}-cursors"; + }; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = pkgs.catppuccin-cursors.${attrName}; + }; + size = lib.mkOption { + type = lib.types.int; + readOnly = true; + default = 24; + }; + path = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "${pkgs.catppuccin-cursors.${attrName}}/share/icons"; + }; + }; }; }; @@ -102,6 +128,7 @@ nixfmt-rfc-style jdk21_headless nerd-fonts.noto + xorg.xcursorgen # kde and kde theming kde-rounded-corners @@ -162,6 +189,22 @@ recursive = true; force = true; }; + ".icons/default/index.theme" = { + text = '' + [Icon Theme] + Name=Default + Comment=Default Cursor Theme + Inherits=${config.userOptions.cursor.name} + ''; + force = true; + }; + }; + + home.pointerCursor = { + gtk.enable = true; + name = config.userOptions.cursor.name; + package = config.userOptions.cursor.package; + size = config.userOptions.cursor.size; }; gtk = { @@ -173,9 +216,9 @@ }; cursorTheme = { - name = "catppuccin-${config.catppuccin.flavor}-${config.catppuccin.accent}-cursors"; - package = pkgs.catppuccin-cursors."${config.catppuccin.flavor}${config.catppuccinUpper.accent}"; - size = 24; + name = config.home.pointerCursor.name; + package = config.home.pointerCursor.package; + size = config.home.pointerCursor.size; }; gtk3.extraConfig = { diff --git a/home/systemd/default.nix b/home/systemd/default.nix index 2e39d7a..32029bc 100644 --- a/home/systemd/default.nix +++ b/home/systemd/default.nix @@ -1,6 +1,17 @@ -{ pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: { + systemd.user.sessionVariables = { + XCURSOR_THEME = config.userOptions.cursor.name; + XCURSOR_SIZE = toString config.userOptions.cursor.size; + XCURSOR_PATH = config.userOptions.cursor.path; + }; + xdg.configFile."rclone/synology.conf".text = '' [synology] type = sftp diff --git a/home/tiling/niri/niri.nix b/home/tiling/niri/niri.nix index 3e3d86f..294c831 100644 --- a/home/tiling/niri/niri.nix +++ b/home/tiling/niri/niri.nix @@ -41,6 +41,8 @@ environment = { QT_QPA_PLATFORM = "wayland"; DISPLAY = null; + XCURSOR_THEME = config.userOptions.cursor.name; + XCURSOR_SIZE = toString config.userOptions.cursor.size; }; outputs = { "eDP-1" = { @@ -56,8 +58,8 @@ cursor = { hide-when-typing = true; hide-after-inactive-ms = 2000; - size = config.gtk.cursorTheme.size; - theme = config.gtk.cursorTheme.name; + size = config.userOptions.cursor.size; + theme = config.userOptions.cursor.name; }; layout = { gaps = 4;