Ideas or code sources:
https://askubuntu.com/questions/1035209/how-to-turn-off-screen-rotation-in-ubuntu-18-04-lts
Heya,
I’ve got my brand new HP notebook with Ubuntu 18.04 and as it turned out it has accelerometer sensor. Sometimes it could randomly rotate my display on start up :) And even locking screen rotation didn’t help.
In order to rotate it back to normal you just need to run following command:
xrandr -o normal
But that’s a temporary solution.
Let’s disable it!
$ sudo systemctl stop iio-sensor-proxy.service
$ sudo systemctl disable iio-sensor-proxy.service
Now you can mask it
$ sudo systemctl mask iio-sensor-proxy.service
or even remove
sudo apt-get remove iio-sensor-proxy
Happy screen rotating!