Skip to content

Force software cursors on nouveau to fix invisible mouse pointer#6161

Open
stephentaylor-com wants to merge 1 commit into
basecamp:devfrom
stephentaylor-com:fix-nouveau-invisible-cursor
Open

Force software cursors on nouveau to fix invisible mouse pointer#6161
stephentaylor-com wants to merge 1 commit into
basecamp:devfrom
stephentaylor-com:fix-nouveau-invisible-cursor

Conversation

@stephentaylor-com

@stephentaylor-com stephentaylor-com commented Jul 3, 2026

Copy link
Copy Markdown

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 cursorpos all 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_cursors defaults to auto, 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-580xx branch in nvidia.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:

hl.config({
  cursor = {
    no_hardware_cursors = true,
  },
})

It writes to ~/.config/hypr/looknfeel.lua — the user override file where Omarchy already keeps cursor settings (see default/hypr/looknfeel.lua) — and is registered in install/config/all.sh right after nvidia.sh.

  • Keyed on the active driver, not a GPU-model regex — covers every affected machine rather than just one card. nouveau only ever binds NVIDIA GPUs, so lspci -k | grep -qi 'Kernel driver in use: nouveau' has no false positives.
  • Idempotent — guarded on an existing no_hardware_cursors setting, so re-running the installer never duplicates the block.
  • lspci is guarded with command -v, and LC_ALL=C keeps the match locale-stable.

Testing

  • Detection verified on the affected hardware (Mac mini, GeForce 320M / MCP89): lspci -k reports Kernel driver in use: nouveau and the script fires.
  • Against the current looknfeel.lua template, the appended block parses cleanly under luac -p.
  • Re-running does not add a second block (idempotency guard).
  • bash -n passes.

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.

Copilot AI review requested due to automatic review settings July 3, 2026 08:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 nouveau and 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.

Comment on lines +9 to +24
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
@stephentaylor-com stephentaylor-com force-pushed the fix-nouveau-invisible-cursor branch 2 times, most recently from 581b03f to 3ca81c2 Compare July 3, 2026 08:14
Copilot AI review requested due to automatic review settings July 3, 2026 08:14
@stephentaylor-com

Copy link
Copy Markdown
Author

Good catch on the Lua config — you're right. dev has moved the Hyprland setup from .conf to Lua (hyprland.luarequire("hypr.*")), so appending .conf syntax to input.conf would never load.

Rewritten to emit Lua and target ~/.config/hypr/looknfeel.lua, which is where Omarchy already keeps cursor settings (see default/hypr/looknfeel.lua):

hl.config({
  cursor = {
    no_hardware_cursors = true,
  },
})

Verified the generated block parses under luac -p. Also folded in the other two suggestions: guarded lspci with command -v and set LC_ALL=C for a locale-stable match. Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

#
# 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
Comment on lines +7 to +8
# 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.
@stephentaylor-com

Copy link
Copy Markdown
Author

Both good catches, thanks.

  1. You're right about the transient-nouveau window during install — a supported NVIDIA GPU still runs nouveau until the first reboot, so keying purely on the live driver would wrongly force software cursors there. Added a [[ ! -f /etc/modprobe.d/nvidia.conf ]] guard so the fix only applies when no proprietary driver was configured (i.e. nvidia.sh hit its "no compatible driver" path — exactly the old-GPU / nouveau-forever case this targets).
  2. Expanded the header comment to note it writes a Lua hl.config block to ~/.config/hypr/looknfeel.lua.

Validated end-to-end on the affected 320M again: guard passes (no nvidia.conf), fix applies, luac -p clean, idempotent.

@stephentaylor-com stephentaylor-com force-pushed the fix-nouveau-invisible-cursor branch from 3ca81c2 to 0d3687c Compare July 3, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants