1

So I've recently bought a new HP ProBook 440 G5 and installed elementaryOS (version missing). It's a dual-boot alongside with Windows 10 (that's likely irrelevant but mentioning just in case).

Anyway, when my laptop is connected to a monitor (via HDMI/VGA) everything is fine. Both screens display everything well. Then I've noticed that when I disconnect the laptop from the monitor, the screen content flips around (upside down, sideways) when I move the lid around. I've googled this problem and found that there is a command

xrandr -o normal

which I'm supposed to add as a startup task. And this works, kinda. The screen doesn't flip anymore while I'm logged in. But as soon as I log out, the login screen goes haywire again.

It's not really that bad, the only problem is when the password field is not in focus so I have to use my touchpad to click it, while my screen is flipped.

Any way to solve this permanently?

Thanks.

2
  • Where did you added that command? (xrandr -o normal)
    – Sebastian
    Dec 12, 2018 at 10:55
  • Settings > Applications > Startup
    – Koy
    Dec 12, 2018 at 10:58

1 Answer 1

2

FIRST METHOD

Create a file, I'll name it no-flip.sh, in /opt

sudo nano /opt/no-flip.sh

Copy this text and paste it into the file and save it

#!/usr/bin/env sh
xrandr -o normal

Execute

sudo chmod a+rx /opt/no-flip.sh

Edit

sudo nano /etc/lightdm/lightdm.conf

Add the lines

[SeatDefaults]
display-setup-script=/opt/no-flip.sh

Reboot


I used nano as my text editor, you can use anyone you like


SECOND METHOD

Create the file /etc/X11/Xsession.d/45custom_xrandr-settings write in it:

# To configure xrandr automatically during the first login,
# save this script to your computer as /etc/X11/Xsession.d/45custom_xrandr-settings:

# Based on https://askubuntu.com/a/678301/890782

# No Flip
xrandr -o normal

NOTE

This should work, at least in theory. Right now doesn't work because you ran the command in the user environment hence when you log out from that user that process is terminated. The theory is that you need to run the command system-wide, and this is one possible method.

7
  • I don't have that .conf file that you mentioned. There is a filed named lightdm.conf.d , but it's empty
    – Koy
    Dec 12, 2018 at 14:41
  • create it, with the same commands with nano will work... you have to know how to save with nano. if you don't use the text editor you like, it doesn't matter
    – Sebastian
    Dec 12, 2018 at 20:02
  • Well I've done this, but now I can't boot into elementary? Just stuck at the logo. Could this be connected or just a coincidence?
    – Koy
    Dec 12, 2018 at 20:43
  • Which logo? Because you just changed a config in the greeter (graphical part) but the system loads before that. If it's the system's logo then this config isn't load at all yet or is loaded but below you have the system running without problems only the X has problems that can be solved. If you mean at the greeter (where you choose the account and type the password) then we just have to rollback the config and try another way. Again.. which logo
    – Sebastian
    Dec 12, 2018 at 21:25
  • The elementaryOS logo (the circled letter 'e'). It just stands there glowing forever.
    – Koy
    Dec 12, 2018 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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