Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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. –  queueoverflow Apr 15 '13 at 19:19
add comment

1 Answer

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
1  
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. –  queueoverflow 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. –  queueoverflow Apr 15 '13 at 18:23
2  
He's looking for something that polls a sensor as opposed to the existent state. –  hbdgaf Apr 19 '13 at 22:46
add comment

Your Answer

 
discard

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.