How do you get the angle of the lid from the CLI? 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.
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:


https://www.reddit.com/r/ProgrammerHumor/comments/6fek1m/hope_you_dont_mind_having_the_volume_turned_up/
https://www.reddit.com/r/ProgrammerHumor/comments/6fowct/lid_controlled_volume_mac_edition/


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.