https://github.com/deepakness/lidangle
Shows the current angle of the MacBook screen in the menu bar
https://github.com/deepakness/lidangle
Last synced: 10 months ago
JSON representation
Shows the current angle of the MacBook screen in the menu bar
- Host: GitHub
- URL: https://github.com/deepakness/lidangle
- Owner: deepakness
- Created: 2025-09-11T08:27:37.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-11T08:37:42.000Z (10 months ago)
- Last Synced: 2025-09-11T11:42:15.021Z (10 months ago)
- Language: Swift
- Size: 9.77 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LidAngle (macOS Menu Bar App)
A tiny menu bar app that displays your Mac’s current lid angle as text (e.g., `120°`).
- Uses the hidden lid angle HID sensor via `IOHIDManager` (Vendor 0x05AC, UsagePage 0x0020, Usage 0x008A), reading Feature Report ID 1.
- No UI beyond the status item text.
- Right‑click (or control‑click) the status item to Quit.
## Build & Run
- Open the Xcode project and run the `LidAngle` target.
- Ensure `IOKit.framework` is linked (Target → Build Phases → Link Binary With Libraries).
- App Sandbox is disabled in `LidAngle.entitlements` to allow HID access.
## Behavior
- Updates the angle about twice per second.
- Shows `—°` if the sensor isn’t available or can’t be read.
- No left‑click action; right‑click shows a one‑item menu (Quit).
## Requirements & Notes
- Hardware: Newer Mac laptops/desktops with a lid angle sensor. Some M1 models reportedly don’t expose the sensor.
- API: Relies on undocumented HID usage; not App Store–safe and may break on OS updates.
- Matching: Falls back from strict (VID+PID+Usage) to relaxed (VID+Usage) to usage‑only.
## Troubleshooting
- If it always shows `—°`, check your hardware, confirm Sandbox is off, and verify `IOKit.framework` is linked. Use the Xcode console to see any read errors.
## Acknowledgments
- Inspired by and built thanks to the work in [LidAngleSensor](https://github.com/samhenrigold/LidAngleSensor). All credit for discovering and demonstrating how to use the hidden lid angle HID API goes to the original author.