Force software cursors on nouveau to fix invisible mouse pointer#6161
Force software cursors on nouveau to fix invisible mouse pointer#6161stephentaylor-com wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an installer-time hardware workaround to make the mouse cursor visible under Hyprland when running on older NVIDIA GPUs using the nouveau DRM driver (by forcing software cursors).
Changes:
- Add a new hardware config step intended to detect
nouveauand apply a Hyprland cursor override. - Register the new step in the install config pipeline immediately after the existing NVIDIA hardware handling.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| install/config/hardware/fix-nouveau-cursor.sh | New hardware-detection script intended to force software cursors under nouveau. |
| install/config/all.sh | Runs the new fix-nouveau-cursor.sh step during install configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if lspci -k | grep -qi 'Kernel driver in use: nouveau'; then | ||
| HYPR_INPUT="$HOME/.config/hypr/input.conf" | ||
|
|
||
| if [[ -f $HYPR_INPUT ]] && ! grep -q 'no_hardware_cursors' "$HYPR_INPUT"; then | ||
| echo "Detected nouveau driver. Forcing software cursors so the mouse pointer stays visible." | ||
|
|
||
| cat >>"$HYPR_INPUT" <<'EOF' | ||
|
|
||
| # nouveau does not display the hardware cursor plane on many older NVIDIA GPUs, | ||
| # leaving the pointer invisible on the physical display. Render it in software. | ||
| cursor { | ||
| no_hardware_cursors = true | ||
| } | ||
| EOF | ||
| fi | ||
| fi |
581b03f to
3ca81c2
Compare
|
Good catch on the Lua config — you're right. Rewritten to emit Lua and target hl.config({
cursor = {
no_hardware_cursors = true,
},
})Verified the generated block parses under |
| # | ||
| # nouveau only ever binds NVIDIA GPUs, so matching the driver line directly is | ||
| # enough to mean "a GPU on this machine is driven by nouveau". | ||
| if command -v lspci &>/dev/null && LC_ALL=C lspci -k | grep -qi 'Kernel driver in use: nouveau'; then |
| # nouveau only ever binds NVIDIA GPUs, so matching the driver line directly is | ||
| # enough to mean "a GPU on this machine is driven by nouveau". |
The nouveau DRM driver does not display the hardware cursor plane on many
older NVIDIA GPUs (e.g. Apple's GeForce 320M / MCP89 in the 2010 Mac mini),
leaving the mouse pointer invisible on the physical display under Hyprland.
Add a hardware fix that detects nouveau as the active DRM driver and forces
software cursors via `cursor { no_hardware_cursors = true }` in the user's
Hyprland looknfeel.lua. Keying on the active driver rather than a GPU-model
regex covers every affected system, and the change is idempotent.
Skip the fix when nvidia.sh has configured the proprietary driver
(/etc/modprobe.d/nvidia.conf present): supported NVIDIA GPUs still run nouveau
during install but switch to the proprietary driver after the first reboot,
which renders hardware cursors correctly.
|
Both good catches, thanks.
Validated end-to-end on the affected 320M again: guard passes (no |
3ca81c2 to
0d3687c
Compare
Problem
On systems using the nouveau driver, the mouse cursor is invisible on the physical display under Hyprland. The compositor tracks the pointer correctly (hover, clicks, and
hyprctl cursorposall work) — it simply is never painted, so local users see no cursor.Root cause
nouveau does not display the DRM hardware-cursor plane on many older NVIDIA GPUs. Hyprland's
cursor:no_hardware_cursorsdefaults toauto, which keeps the hardware cursor plane in use, so the pointer never renders.This turned up on a 2010 Mac mini (Apple GeForce 320M / MCP89) — a GPU too old for even the legacy
nvidia-580xxbranch innvidia.sh, so Omarchy correctly leaves it on nouveau. But nothing then addresses the cursor, so the install boots to an invisible pointer.Fix
Add
install/config/hardware/fix-nouveau-cursor.sh, which detects nouveau as the active DRM driver and appends a software-cursor override to the user's Hyprland config:It writes to
~/.config/hypr/looknfeel.lua— the user override file where Omarchy already keepscursorsettings (seedefault/hypr/looknfeel.lua) — and is registered ininstall/config/all.shright afternvidia.sh.lspci -k | grep -qi 'Kernel driver in use: nouveau'has no false positives.no_hardware_cursorssetting, so re-running the installer never duplicates the block.lspciis guarded withcommand -v, andLC_ALL=Ckeeps the match locale-stable.Testing
lspci -kreportsKernel driver in use: nouveauand the script fires.looknfeel.luatemplate, the appended block parses cleanly underluac -p.bash -npasses.The underlying one-line setting (
no_hardware_cursors = true) was first applied by hand on the affected machine and confirmed to make the cursor visible.