How to rotate Yoga 370 screen
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).
#! /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
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
[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