13 August 2026 · 4 min read
One mouse, two Macs, and a constraint you cannot argue with
Magic peripherals store exactly one pairing. The fix was to stop fighting that and script the divorce.
I use one Magic Mouse and one Magic Keyboard across two Macs, a personal one and a work one. Apple's answer to this is a cable. Plug the peripheral in, it re-pairs instantly to whatever it is plugged into, unplug, repeat forever. I wanted a menu bar button instead.
The constraint
Magic peripherals store exactly one pairing. Not a preferred host with fallbacks, one. Pairing with Mac B invalidates Mac A's link key, and a device that is currently paired flatly ignores connection attempts from anyone else. You do not get a rejection, you get page timeouts and a device that is not even discoverable.
So the obvious design, keep it paired to both and just reconnect on demand, is not a hard problem to solve. It is impossible. Bluetooth will not let you have it, and no amount of clever reconnect logic changes that.
What actually works
Once you accept the constraint, the solution stops being a reconnect and becomes a scripted handover. Verified on real hardware:
- The Mac that currently owns the devices unpairs them
- The Mac you are sitting at clears its stale record and pairs fresh. Magic devices pair PIN-less, so this is fully programmatic
- The device only answers a new host while it is awake
That last one is the detail that turns a working script into a working product. A sleeping mouse ignores everything, so the claim loop retries patiently for ninety seconds while you wiggle the mouse or tap a key. If it is truly asleep, a power cycle, off for three seconds and back on, is the reliable fallback. Most of the polish in this app is that retry window and telling you plainly what to do during it.
Two Macs talking
The handover needs coordination, because the Mac you are leaving has to let go before the Mac you are arriving at can grab. They find each other over the local network with Bonjour and exchange a token-authenticated TCP message. No SSH access, no accounts, no cloud, nothing leaves your network.
Click Pull Input Here on the Mac you want to use, nudge the mouse, and the peripherals jump over.
The lesson
I spent the first evening trying to defeat the one-pairing rule and got nowhere, because it is not a bug or an oversight, it is how the pairing model works. The app only got good once I stopped treating the constraint as the enemy and started designing the smoothest possible ritual around it.