Fix a cursor that changes size between mixed-DPI monitors
Symptom
The mouse cursor is a tiny speck on the 4K screen and a giant arrow on the 1080p one, or it changes size the moment it crosses between monitors. Sometimes the cursor is completely invisible over XWayland windows or in a VM.
Cause
XCursor themes are bitmaps at fixed sizes, so a single XCURSOR_SIZE cannot be right on two displays with different scales. Omarchy ships XCURSOR_SIZE=24 and HYPRCURSOR_SIZE=24 in /usr/share/omarchy/default/hypr/envs.lua. Invisible cursors are usually a hardware-cursor plane the driver cannot commit (vmwgfx, some virtual GPUs).
Fix
Set both sizes together. They must agree, or the cursor changes size between Wayland-native and XWayland surfaces. In ~/.config/hypr/looknfeel.lua (or your own Hyprland config):
hl.env("XCURSOR_SIZE", "32")
hl.env("HYPRCURSOR_SIZE", "32")
On Hyprland <= 0.54: env = XCURSOR_SIZE,32 and env = HYPRCURSOR_SIZE,32.
Keep GTK's own setting in sync so CSD apps agree:
gsettings set org.gnome.desktop.interface cursor-size 32
For an invisible cursor (VMs, vmwgfx, some NVIDIA setups), fall back to a software cursor:
hl.config({ cursor = { no_hardware_cursors = 1 } })
On NVIDIA, hardware cursors need cursor.use_cpu_buffer (default 2 = auto-on for NVIDIA). Set it to 1 if the cursor is corrupt.
Log out and back in for the env change to reach already-running apps.
Verify
The cursor is the same apparent physical size on both monitors and stays visible over XWayland windows.
Sources
- https://github.com/basecamp/omarchy/blob/quattro/default/hypr/envs.lua
- https://github.com/hyprwm/hyprland-wiki/blob/main/content/Configuring/Basics/Variables.md
- https://github.com/hyprwm/hyprland-wiki/blob/main/content/Configuring/Advanced%20and%20Cool/XWayland.md
- https://github.com/basecamp/omarchy/issues/7918