
MagSafe Guard is a menu-bar app for macOS 13+: the MagSafe / power cable becomes a dead-man’s switch. Arm it, unplug the cable — and the Mac protects itself.
The problem Link to heading
Working on a laptop on trains, in cafés, or at conferences comes with a familiar risk: look away for a moment and the machine is gone. Classic anti-theft USB dongles work, but they are awkward to carry. MagSafe is already on the Mac — so why not use that cable as the trigger?
The approach Link to heading
The app lives in the menu bar (no Dock icon). Daily flow:
- Arm — enable protection while power is connected
- Cable out — a grace period starts (default 30 seconds, configurable)
- Grace — countdown in the menu bar; plugging back in or authenticating cancels it
- Triggered — configured actions run (lock screen, alarm, logout, …)
Profiles such as Discreet or Panic shorten the time to trigger — down to an immediate response.

Challenges Link to heading
- Reliable detection without a kernel extension: power events come through IOKit — MagSafe and USB-C.
- Avoid false positives: accidental unplugs must not nuke the session → grace period, cancel on reconnect, Touch ID / password.
- Distribution: notarized DMG releases instead of the App Store; CI and local tests keep quality and security in check.
Light tech Link to heading
An independent fork of lekman/magsafe-buskill, inspired by the classic BusKill idea. Swift/SwiftUI menu-bar app, state model disarmed → armed → grace → triggered, actions in a fixed order. No kernel module.
What I took away Link to heading
Hardware you already carry can be a thin security net — if the UX forgives mistakes (grace) and the platform does not require deep hooks. Open source plus notarized packaging makes that path understandable and installable for others.
Repo & downloads: github.com/sutz2001/MagSafe-BusKill