Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

share|improve this question
Just to check - is this possible on other OSs? – jackweirdy Apr 15 '13 at 19:05
Never booted Windows on this one, so I have no idea. – Martin Ueding Apr 15 '13 at 19:19

I found this on the thinkpads forum. Relevant part of the script in the link:

rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\) 
(normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"
share|improve this answer
My think-rotate is based on this. But that only queries the current rotation state of the screen. It has nothing to do with the physical state of the screen. – Martin Ueding Apr 15 '13 at 17:06
Ok true, then please explain to me what you mean with "physical state". To me the physical state of the screen changes when -I- walk around the table (since the screen from my point of view turned up side down). – Rinzwind Apr 15 '13 at 17:11
I added some images. – Martin Ueding Apr 15 '13 at 18:23
He's looking for something that polls a sensor as opposed to the existent state. – RobotHumans Apr 19 '13 at 22:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.