Monitor Lay issues on Login

Hey everyone, I’m just wondering if anyone else is getting the weird little bug on login. I have two monitors. A 27" ultra wide, and a 17" monitor.
They are positioned like so:
27" | 17"
27 on the left and 17 on the right.
All is good until I get to the login screen on the first load (this might also happen if I log out, but I haven’t tested it just yet).
When I log in the order of the monitors is switched to
17" | 24"
This means that I have to move my mouse all the way to the left just to wrap around to my right monitor.
When I get to the Desktop it’s fixed, so this isn’t too big of a deal but I was wondering if this was a known issue or not.
Thanks!

Do this in a term

xrandr | grep ’ connected’

for me the output looks like this (27" 1080p primary to the left, 21" 1050p to the right):

DVI-D-0 connected 1680x1050+1920+0 (normal left inverted right x axis y axis) 434mm x 270mm
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm

This will give you a listing of the displays and their geometry. You will then need to build a simple xrandr string based on what you see there and add it to

/usr/share/sddm/scripts/Xsetup

at the bottom that will look something like this:

xrandr --output HDMI-0 --mode 1920x1080 --pos 0x0 --rotate normal
xrandr --output DVI-D-0 --mode 1680x1050 --pos 1920x0 --rotate normal

Note the “–pos” value. This places the smaller 1680x1050 display to the right of the larger 1080 display by 1920 pixels. The “–output” (DP, HDMI, DVI connectors), the “–mode” (resolution), and so on will depend on your own hardware.

I rotate the smaller display clockwise to be in portrait mode, and that is simply done by changing the “–rotate” from “normal” to “left”.

Save the file and logout. It should now be correct.

Further details can be found by typing “man sddm”.

Alternatively you can simple physically reverse the order of the connectors… move the plugs from one to the other if they are the same type. You may have to reset the primary once you are logged in.

1 Like

Hey sorry for the delayed response, I have been away from my desktop. I applied your settings as defined above, but nothing has changed in my layouts. I also tried to use the apply settings from the System Settings → Color and Themes → SDDM which did nothing. Unfortunately I can not change the order of the connectors at this time. Thank you for referring me to where to look. I’ll keep experimenting on this for now.

If you are using X11 and want to position using xrandr, then the following is what I do…

Find out how the monitors are connected by running:

xrandr | grep ' connected' 
DP-0 connected 3360x2100+3840+0 (normal left inverted right x axis y axis) 546mm x 352mm
DP-4 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 340mm

Then do something like:

xrandr --output DP-4 --auto --output DP-0 --auto --right-of DP-4

In my case, DP-0 is physically on the right of DP-4.

To have this done during login (for everyone): as root, or via sudo, put the above line in a new file in /etc/X11/xinit/xinitrc.d/, such as /etc/X11/xinit/xinitrc.d/50-xrandr.sh

I also had to disable KScreen2 which I think Plasma uses to automatically configure/reconfigure screens/windows when monitors power up/down. There is an application called ‘Background Services’ - which can be searched for from the launcher (aka start menu), use it disable entry for the kscreen2 background service.

In my case I’ve also specifying scaling via xrandr, that may be why I had to disable kscreen2 - can’t remember for sure. This is exactly what I use for an unscaled 4K on left and a scaled-up 1900x1200 on the right:

xrandr --output DP-4 --auto --output DP-0 --auto --scale 1.75x1.75 --right-of DP-4 --mode 1920x1200