macOS – How to Get the Angle of the Lid from CLI

command linehardwaremacbook promacos

I know that you get whether the lid is open or closed from:

ioreg -r -k AppleClamshellState -d 4 | grep AppleClamshellState.

What I want to know is if the lid is open, what is its angle relative to the plane it is sitting on.

Best Answer

There is no easy way to do this from within the computer (you could always measure it of course). The hardware on laptops only needs to know whether the lid is closed or not, so a simple on/off switch is enough and built-in.


There are (at least) two threads on reddit where apparently the tilt level seems to control audio volume:

The first one is quite obviously a fake, the second one claims

You're right! I used the ambient light sensor values to calculate the percentage

So while there isn't a way to get the angle directly, it can be calculated/approximated using other sensors.