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
  • 70,465

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
  • 299,756
-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 – David Feb 19 '22 at 14:55