I have a ThinkPad X220 where one can flip the screen. I'd like to use the physical state of the laptop in a script, like letting ACPI or udev call the rotation script when I rotate the laptop.
How can I find out where the state of the laptop is exposed, if at all?
The states that I mean: