bend
Read the MacBook lid angle from the command line. Written in Zig.
HomebrewShell
bend
What is this
MacBooks have a sensor that reports the angle of the lid hinge. macOS doesn’t expose it as a number, but bend does, via IOKit.
Small native binary. Useful for scripting around lid position, triggering scripts when the lid moves past a threshold, or just reading the current angle.
Quick start
$ bend
96
# Live feed
bend --watch
# Block until the lid closes past 30°
bend --wait-until 30-
Documentation
- Usage — modes, options, threshold syntax, exit codes
- Build from source
License
MIT — see LICENSE.