3

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:

Zanna
  • 69,223
  • 56
  • 216
  • 327
Martin Ueding
  • 8,218
  • 11
  • 52
  • 83

2 Answers2

0

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)')"
Rinzwind
  • 293,910
  • 41
  • 570
  • 710
  • 1
    My [think-rotate](http://martin-ueding.de/projects/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
  • 2
    He's looking for something that polls a sensor as opposed to the existent state. – RobotHumans Apr 19 '13 at 22:46
-1

https://askubuntu.com/a/349239

and

https://askubuntu.com/a/611062

combined with

https://help.ubuntu.com/community/LaptopLidAndDockScripts

might help you find a solution. Currently looking into the same issue. Will post again if I arrive at a script solution artifact in sensible amounts of time.

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/1207636) – David Feb 19 '22 at 14:55