5

currently I'm trying to disable the process which is responsible for handling the auto-screen rotation on my Lenovo Yoga 2 Pro, which is enabled by default.

So far I did some research on the packages iio-sensor-proxy and inotify-tools, but I couldn't figure out how to disable it.

Is it possible to just remove iio-sensor-proxy to achieve the desired behaviour?

Or would that affect any important process in a negative way and cause anomalies?

Where are the configuration files stored?

Thanks in advance!

Zanna
  • 70,465

2 Answers2

7

I have since found a more practical way of disabling screen rotation, but it only works in the GNOME desktop environment and not in Unity.

In GNOME click on the top right menu. The button in between the one that opens the Settings menu and that locks your screen controls your screen rotation. Click the button to disable it.

This screenshot was taken from a similar question for Fedora:

Location of the screen rotation toggle in GNOME

This feature does not appear to be in Unity. A graphical tool that will at least help you with your screen rotation in Unity is called ScreenRotator.

DCKing
  • 317
6

On Ubuntu 16.10, I was able to disable automatic screen rotation with this train of thought:

  1. I confirmed that it was the iio-sensor-proxy service that was causing the screen to automatically rotate. Running systemctl stop iio-sensor-proxy stops screen rotation until next boot.
  2. The iio-sensor-proxy service is a static SystemD service for some reason and therefore cannot be disabled using systemctl disable iio-sensor-proxy, so you have to remove it to disable permanently. However, the scant documentation indicates that this service also controls the ambient light sensor and the compass, which I don't want to disable if I don't have to.
  3. Using the apt-file utility (which is not installed by default), I determined which files are installed for the package associated with this service, by running apt-file list iio-sensor-proxy. It appears to install a configuration file /lib/udev/rules.d/80-iio-sensor-proxy.rules - where udev is Ubuntu's hardware management subsystem. That seems to be the place to look.
  4. Notice that this file contains a line SUBSYSTEM=="input", ACTION=="add", TAG+="systemd", ENV{ID_INPUT_ACCELEROMETER}=="1", ENV{SYSTEMD_WANTS}+="iio-sensor-proxy.service". This appears to control the accelerometer that triggers the automatic rotation. Comment it out by putting a # in front of this line to prevent this service from reading the accelerometer.
  5. After a reboot, automatic screen rotation should be disabled while iio-sensor-proxy is still running.

Clearly there should be a GUI option for this, let alone a documented way of doing this, but there you go.

DCKing
  • 317