Difference between revisions of "How to rotate Yoga 370 screen"

From ThinkWiki
Jump to: navigation, search
(Add Yoga 370 screen rotation workaround)
 
m (Remove verbose description)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
[[:Category:Yoga 370|Yoga 370]][[Category:Yoga 370]][[Category:Scripts]][[Category:HOWTOs]]
 
[[:Category:Yoga 370|Yoga 370]][[Category:Yoga 370]][[Category:Scripts]][[Category:HOWTOs]]
  
Even though the thinkpad-acpi module recognizes the Notebook-to-Tablet transformation event (0x60f0) the correct implementation of the screen rotation functionality is not possible because the acpi device method for determining the transformation state is currently unknown.
+
This little script triggers the rotation of the screen when executed while the device is tilted.
 
 
So in the meantime a little script helps out that triggers the rotation of the screen when executed while the device is tilted.
 
 
The script was tested under Fedora 25 (4.10.13-200.fc25.x86_64).
 
The script was tested under Fedora 25 (4.10.13-200.fc25.x86_64).
  
Line 19: Line 17:
  
  
Now you can call this script by your script or manual with a desktop file
+
Now you can call this by a script or manual by clicking on a desktop file
  
 
{{path|~/.local/share/applications/rotate-screen.desktop}}
 
{{path|~/.local/share/applications/rotate-screen.desktop}}

Latest revision as of 11:49, 6 May 2017

Yoga 370

This little script triggers the rotation of the screen when executed while the device is tilted. The script was tested under Fedora 25 (4.10.13-200.fc25.x86_64).

/usr/bin/screen-rotation.sh

#! /bin/bash 
/usr/bin/cat /sys/bus/iio/devices/iio\:device3/in_accel_x_raw


Allow the execution of this script with a sudoers.d file

/etc/sudoers.d/screen-rotation

yourUser ALL=(ALL) NOPASSWD: /usr/bin/screen-rotation.sh


Now you can call this by a script or manual by clicking on a desktop file

~/.local/share/applications/rotate-screen.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=Screen Rotation
Icon=~/screen-rotation.png
Exec=sudo /usr/bin/screen-rotation.sh
Comment=Rotate the screen
Categories=Script;Tool;
Terminal=false