DEV Community

Cover image for I made a free Mac window manager because Magnet doesn't exist outside the App Store
Alan West
Alan West

Posted on • Originally published at nudge.run

I made a free Mac window manager because Magnet doesn't exist outside the App Store

I've been using Magnet for years, no complaints. Then I picked up a Mac Mini to run OpenClaw agents 24/7. Didn't want to sign in with my Apple ID on that machine, so I set it up without the App Store.

And that's when I realized — Magnet is App Store only. No DMG, no Homebrew, nothing. Can't use it without signing in.

I tried going without a window manager for two days. Couldn't do it. So I just built one.

Nudge

Nudge is a free, open-source macOS window manager. Pure Swift/AppKit, under 1MB, zero dependencies.

Started with keyboard shortcuts — snap left half, right half, quarters, that kind of thing. Then I added drag-to-edge snapping because I kept reaching for it out of habit. Then multi-monitor support because I realized I'd need it on my main setup too. Ended up with 19 layouts and it covers everything I used Magnet for.

What it does

  • 19 snap layouts — halves, quarters, thirds, two-thirds, maximize, center, restore
  • Keyboard shortcuts — fully remappable through the settings panel
  • Drag-to-edge snapping — drag a window to a screen edge, see a preview overlay, release to snap
  • Multi-monitor — press the same shortcut twice, window moves to the next display with mirrored position

Here's what it looks like in action:

Nudge window snapping demo

Every shortcut uses Ctrl+Option as the base modifier. Arrow keys for halves, U/I/J/K for quarters, D/F/G for thirds.

Why not just use Rectangle?

Rectangle is a solid app. If you're happy with it, you probably don't need Nudge.

But I wanted something minimal. Rectangle pulls in dependencies and ships around 15MB. Nudge is 17 Swift files, under 1MB, no external dependencies at all. The entire codebase is readable in an afternoon.

Nudge Magnet Rectangle
Price Free $9.99 Free
Open Source Yes (MIT) No Yes
App Size <1MB ~5MB ~15MB
Drag-to-Edge Yes Yes Yes
Multi-Monitor Yes Yes Yes
App Store Required No Yes No

Technical bits

The whole thing is Swift and AppKit. Hotkeys use Carbon's RegisterEventHotKey — still the most reliable way to register global shortcuts on macOS. Drag detection uses a CGEvent tap listening for mouse drags near screen edges. Window manipulation is through the Accessibility API (AXUIElement).

One fun problem I ran into: some Electron apps (like Claude desktop) don't properly expose their windows through the Accessibility API. The app reports 0 windows even though you can see the window on screen. Fixed it by falling back to CGWindowListCopyWindowInfo and matching windows by PID and bounds.

Another issue: Chrome enables AXEnhancedUserInterface which causes animated window moves when you set position/size via AX. Disabling that flag before each move fixes it. Rectangle uses the same workaround.

Install

Homebrew:

brew tap mikusnuz/tap
brew install nudge-run
Enter fullscreen mode Exit fullscreen mode

Or grab the DMG from GitHub Releases.

Build from source:

git clone https://github.com/mikusnuz/nudge.git
cd nudge
brew install xcodegen
xcodegen generate
open Nudge.xcodeproj
Enter fullscreen mode Exit fullscreen mode

On first launch, macOS will ask for Accessibility permissions. That's the only permission it needs.


Now I use it on all my Macs. The whole source is on GitHub under MIT. If you find any bugs, open an issue.

Website: nudge.run

Top comments (0)