Privacy-first macOS menu bar utility that reads a compatible MacBook lid-angle sensor and runs local automations at configured thresholds.
This repository ships a menu bar app (Lid.app) plus a lid-sensor diagnostic. Hardware support is still limited to models in the matrix below.
Lid is inspired by LidAngleSensor, Sam Henri Gold's fun Mac utility that reads the same undocumented lid-angle HID sensor and (optionally) creaks like a wooden door when you move the display slowly.
That project showed the sensor was reachable. This one is a separate, original implementation aimed at local privacy automations. Phase 0 does not copy its source.
Lid does not claim support for untested hardware.
Verified in this repository:
| Model | Chip | macOS | Sensor |
|---|---|---|---|
| Mac16,8 (MacBook Pro 14-inch, 2024) | M4 Pro | 26.6.2 | Detected. Degrees from closed via undocumented IOKit HID. |
Community reports mention a sensor on some 2019 16-inch MacBook Pro and later models, and failures on some M1 and M2 machines. Those reports are not a support list. See docs/hardware-compatibility.md.
- Local only. No account, cloud, analytics, telemetry, or network client.
- No camera, microphone, or screen capture.
- Accessibility is requested only if you enable or test lock.
- Music/Spotify may ask for Automation access after you enable media pause.
- Diagnostics never include raw HID payloads, window titles, usernames, or file paths.
- macOS 14 or later
- Xcode / Swift 6 toolchain
- Compatible lid-angle hardware, or
--simulate
./scripts/run-app.shThat builds artifacts/Lid.app and opens it. Lid has no Dock icon. Look in the menu bar for the angle or the word Lid.
Package a drag-and-drop Lid.app:
./scripts/package-app.sh releaseThat writes artifacts/Lid.app. Drag it into Applications, or open it from that folder.
For a disk image with an Applications shortcut:
./scripts/package-dmg.sh
open artifacts/Lid.dmgLaunch at login works only from that .app bundle, not from swift run. The package is ad-hoc signed for local use. Sharing it to other Macs still needs Developer ID signing and notarization.
swift test -Xswiftc -warnings-as-errors
swift run lid-sensor --help
swift run lid-sensor --once
swift run lid-sensor --list
swift run lid-sensor --simulate --duration 2
./scripts/run-sensor-diagnostic.sh --duration 10A 10-minute soak, used for leak and crash checks:
./scripts/run-sensor-diagnostic.sh --duration 600Hardware XCTest is opt-in:
LID_HARDWARE_TEST=1 swift test --filter HardwareProbeTestsReusable logic lives in the LidCore Swift package target. LidApp is the menu bar UI. lid-sensor is the diagnostic CLI.
Undocumented HID constants stay inside IOKitLidAngleProvider.
This project is licensed under the MIT License.
Product source in this repository is original. Phase 0 does not copy third-party sensor implementations. Public HID research is cited in docs/hardware-compatibility.md.