Hyprland: cursor disappears on some apps

Hi!

I moved to hyprland from Gnome and for some apps it seems that the cursor just disappears, here is a video showcasing the issue:

You can see my dotfiles here. I’ve tried addressing this issue with stuff I found on the web, but it didn’t work:

modified   homes/woody/home.nix
@@ -95,6 +95,12 @@ in
       SOPS_PGP_FP = "1E12 2246 6B30 776E 0A48 1377 CD3E 0427 6FC1 C1A1";
       STEAM_EXTRA_COMPAT_TOOLS_PATHS = "$HOME/.steam/root/compatibilitytools.d";
       XDG_SCREENSHOTS_DIR = "$HOME/Imágenes/Capturas de pantalla/";
+      WLR_NO_HARDWARE_CURSORS = 1; # https://www.reddit.com/r/NixOS/comments/105f4e0/invisible_cursor_on_hyprland/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
+    };
+    pointerCursor = {
+      gtk.enable = true;
+      x11.enable = true;
+      size = 32;
     };
   };
1 Like

Did you reboot after changing the config and switching?

yes, I did that when I did the modification just to be sure

I too experience the cursor disappearing every now and then only on Alacritty! It is so hard to reproduce this issue so I never managed to issue a bug report or to diagnose it (and that’s why it is so annoying), thanks for sharing this issue here.

I just rebooted my system with the same change and I’ll update here if it worked for me. I’m using GNOME on nixos-unstable, and I’m not using Zoom (an app which I’d suspect acts fishy either-way).

According to NVidia – Hyprland Wiki:

Previously used WLR_NO_HARDWARE_CURSORS environment variable has been deprecated. Do not set it in your configs. Use cursor:no_hardware_cursors instead.

So you should give that a try.

There is also a home.pointerCursor.hyprcursor option that might help.

Edit: This issue might be specific to your current cursor theme as according to the latest catppuccin-cursors-1.0.2 release:

This release should resolve all the issues raised on Hyprland as we are distributing SVGs (again) in the zip.

The update has already been backported to release-24.11, but I think you’ll have to use an overlay until it’s available in nixos-24.11:

nixpkgs.overlays = [
  (final: prev: {
    catppuccin-cursors = prev.catppuccin-cursors.overrideAttrs (oldAttrs: rec {
      version = "1.0.2";
      src = final.fetchFromGitHub {
        owner = "catppuccin";
        repo = "cursors";
        rev = "v${version}";
        hash = "sha256-Mm0fRh/Shem65E/Cl0yyw+efEHOEt/OJ+MzL+3Mcbwc=";
      };
      nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ pkgs.zip ];
      buildPhase = ''
        runHook preBuild
        patchShebangs .
        just all
        runHook postBuild
      '';
    });
  })
];

I’m using Gnome too and I used to have this issue with either Wezterm or Kitty, but I don’t remember how I exactly solved it. It might have been home.pointerCursor.

1 Like

Man, cursor managment in Hyprland is a hot mess. Things may have changed since I tested on the 24.05 channel but I found:

Emacs uses this (needs Hyprland restart):

env = XCURSOR_THEME,Bibata-Modern-Classic
env = XCURSOR_SIZE,24

Hyprland desktop and kitty uses this (does not require restart when run in terminal - theme persists across restarts, but not size. Nothing written to any config file I could find):

exec-once = hyprctl setcursor Bibata-Modern-Classic 24

Firefox uses this (does not require restart when run in terminal):

exec-once = dconf write /org/gnome/desktop/interface/cursor-theme "'Bibata-Modern-Classic'"
exec-once = dconf write /org/gnome/desktop/interface/cursor-size 24

Bibata from the commands above is not a Hyprcursor theme, just normal. I gave up making the Hyprcursor stuff work.

1 Like