2

So i just recently purchased an HP 840 G2 and decided to make the switch to Elementary OS along with the purchase.

Running into an issue with the screen constantly rotating when the laptop is moved.

It also always rotates the screen if the computer times out and locks regardless if the laptop has been moved or not.

I looked into some possible fixes and kind of solved my problem.

running:

$ gsettings set org.gnome.settings-daemon.plugins.orientation active false

didn't net me any results.

running:

$ sudo systemctl stop iio-sensor-proxy.service

stops the screen rotation for the duration of the session.

If the laptop times out or is shutdown/restarted, the issue returns.

I did some more looking and i think i may have to run the latter as a startup script in order to have the issue fully resolved.

If so, any ideas on how to go about this? found 1 tutorial but i don't have the best knowledge when it comes to coding and scripting. Beginner at best. Or is there a simpler answer out there?

3

If this sudo systemctl stop iio-sensor-proxy.service works temporarily for you, then disable it so next time you reboot, it will not load

To disable it:

sudo systemctl disable iio-sensor-proxy.service

If disable don't work (sometimes services are called externally or by other enabled and needed services), just mask it into null and will not run no matter what

sudo systemctl mask iio-sensor-proxy.service
  • Thank you! Disable stopped all 90 degree rotation, mask completely solved the issue, both 90 degree and screen inversion. – WolfmanJack Dec 17 '18 at 12:12
0

Easiest way without messing around with init.d/services etc perhaps simply put the script in /etc/rc.local. Not sure if elementaryOS has this setup by default, if it doesn't exist follow these steps https://askubuntu.com/a/401090.

(edit: the answer by Sebastian is much better, I completely overlooked that it was just disabling a service.)

  • 1
    No worries, appreciate the speedy response. Opened up a new area to get read up on as it pertains to learning about this new OS and how to write script and work in terminal. – WolfmanJack Dec 17 '18 at 12:14
0

I'm not sure, but wasn't it there an option like rotation lock or something in System Setting under screen settings?

Also could someone with more reputation convert this answer into a comment to the first answer please, thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.