diff --git a/hosts/terra/configuration.nix b/hosts/terra/configuration.nix index 1841f41..ec6b88a 100644 --- a/hosts/terra/configuration.nix +++ b/hosts/terra/configuration.nix @@ -89,6 +89,7 @@ in primaryOutput = "DP-2"; defaultUser = "darman"; keyboardLayout = "de"; + cursor = { inherit (config.home-manager.users.darman.home.pointerCursor) name size package; }; }; services.flatpak = { diff --git a/hosts/terra/home/theme.nix b/hosts/terra/home/theme.nix index 12c0803..4e9c82c 100644 --- a/hosts/terra/home/theme.nix +++ b/hosts/terra/home/theme.nix @@ -32,7 +32,7 @@ in home.pointerCursor = { name = "HyprChrome"; package = hyprchromeCursors; - size = 24; + size = 36; gtk.enable = true; hyprcursor.enable = true; }; diff --git a/pkgs/hyprchrome-cursors.nix b/pkgs/hyprchrome-cursors.nix index 38097c6..bc1fe66 100644 --- a/pkgs/hyprchrome-cursors.nix +++ b/pkgs/hyprchrome-cursors.nix @@ -6,7 +6,7 @@ # hyprcursor (SVG, so it stays sharp at any size) in a single theme dir. let name = "HyprChrome"; - xcursorSizes = [ 24 32 48 ]; + xcursorSizes = [ 24 32 36 48 ]; # hotspot on the 32px grid, as in the canvas; aliases are the X11/CSS names # that should resolve to this shape. diff --git a/services/desktop/quickshell-greeter.nix b/services/desktop/quickshell-greeter.nix index 8402c86..6a05d5f 100644 --- a/services/desktop/quickshell-greeter.nix +++ b/services/desktop/quickshell-greeter.nix @@ -7,6 +7,7 @@ let cfg = config.homelab.greeter; hyprland = config.programs.hyprland.package; toLua = lib.generators.toLua { }; + greeterHome = config.users.users.greeter.home; shellDir = ../../dotfiles/quickshell; @@ -32,6 +33,12 @@ let hl.env("QS_GREETER_USER", ${toLua cfg.defaultUser}) hl.env("QS_GREETER_HOST", ${toLua config.networking.hostName}) hl.env("QS_GREETER_SESSION", "start-hyprland") + ${lib.optionalString (cfg.cursor != null) '' + hl.env("HYPRCURSOR_THEME", ${toLua cfg.cursor.name}) + hl.env("HYPRCURSOR_SIZE", "${toString cfg.cursor.size}") + hl.env("XCURSOR_THEME", ${toLua cfg.cursor.name}) + hl.env("XCURSOR_SIZE", "${toString cfg.cursor.size}") + ''} hl.on("hyprland.start", function() hl.exec_cmd("${session}") @@ -58,6 +65,11 @@ in type = lib.types.str; default = "us"; }; + cursor = lib.mkOption { + type = lib.types.nullOr lib.types.attrs; + default = null; + description = "{ name, size, package } cursor theme; reuse the user's pointerCursor."; + }; }; config = { @@ -72,5 +84,12 @@ in home = "/var/lib/greeter"; createHome = true; }; + + # ~/.icons is searched by both hyprcursor and libXcursor; the greeter's + # XDG_DATA_DIRS isn't something we control. + systemd.tmpfiles.rules = lib.optionals (cfg.cursor != null) [ + "d ${greeterHome}/.icons 0755 greeter greeter -" + "L+ ${greeterHome}/.icons/${cfg.cursor.name} - - - - ${cfg.cursor.package}/share/icons/${cfg.cursor.name}" + ]; }; }