Skip to content

cameronobriendev/NotchWall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NotchWall

A tiny macOS background agent that keeps your mouse cursor out of the MacBook notch, so it never disappears behind it.

When you drag the pointer up into the notch region, macOS lets it vanish behind the camera housing. NotchWall puts an invisible wall there: the cursor stops at the notch's edges instead of disappearing, and slides smoothly along them. The two bottom corners are rounded to match the notch's shape.

  • No UI, no menu bar icon — it's a pure background agent.
  • Auto-adapts to any resolution — it reads the live notch geometry from macOS (safeAreaInsets / auxiliaryTopLeftArea), not hardcoded numbers, and recomputes whenever the display configuration changes.
  • Works on any notched Mac — developed and tuned on a 14″ MacBook Pro (M4, Mac16,8), but the geometry is detected at runtime so it adapts to other notched models and scalings.
  • Tiny — a single Swift file, no dependencies.

Install

Requires Xcode command-line tools (for swiftc).

git clone https://github.com/cameronobriendev/NotchWall.git
cd NotchWall
./build.sh                 # builds NotchWall.app into ~/Applications, ad-hoc signed
open ~/Applications/NotchWall.app

Then grant the one permission it needs:

System Settings → Privacy & Security → Accessibility → enable NotchWall

(It needs Accessibility to create the mouse event tap. It shows the system prompt once on first launch, then starts the instant you grant it — no relaunch needed.)

Start at login

Either add NotchWall.app under System Settings → General → Login Items, or use the included LaunchAgent:

cp com.cameron.notchwall.plist ~/Library/LaunchAgents/
# edit the path inside it to point at your NotchWall.app, then:
launchctl load ~/Library/LaunchAgents/com.cameron.notchwall.plist

How it works

A CGEventTap watches mouse-move/drag events. When the cursor crosses into the notch rectangle, NotchWall warps it back to the nearest edge:

  • From below → stops at the bottom edge.
  • From the left/right → stops at that side (height preserved), so you go around the notch.
  • Bottom corners are rounded — the cursor is pushed radially along an arc instead of catching on a square corner.
  • A small deadband past each edge means sliding alongside the notch doesn't re-trigger, so it feels free, not sticky.

Why warp instead of editing the event?

On current macOS the window server ignores event location/delta edits at the HID tap for real hardware input — only an actual reposition moves the cursor. So NotchWall warps synchronously (minimal flash), only on the frames the cursor actually crosses in, and deliberately does not call CGAssociateMouseAndMouseCursorPosition (which makes the cursor feel "held"/glued).

Tuning

All distances are in points and can be overridden with environment variables (defaults in parentheses):

Var Default Meaning
DEADBAND 3 px past an edge to park the cursor (bigger = less jitter)
LEFTPAD 7 extra px on the left edge so the arrow's body (which extends right from its hotspot) clears the notch
CORNER 10 radius of the rounded bottom corners
CURVEPAD 2 left padding used by the bottom-left curve only, so it doesn't bulge out

Example: DEADBAND=5 CORNER=8 open -n ~/Applications/NotchWall.app (or set them in the LaunchAgent's environment).

Developing

build.sh ad-hoc signs, which means macOS revokes the Accessibility grant on every rebuild. If you iterate frequently, sign with a stable self-signed identity so the grant persists:

# one-time: create a self-signed code-signing identity named "NotchWall Local",
# then sign with it instead of `-`:
codesign --force --sign "NotchWall Local" --identifier com.cameron.notchwall ~/Applications/NotchWall.app

License

MIT — see LICENSE.

About

Keep the mouse cursor out of the MacBook notch — a tiny, UI-less background agent that walls it out (auto-detects notch geometry, any resolution).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors