I have some desktops in the office that have their monitor layouts in reverse. While I know its possible to do it via xrandr or even manually rearranging the monitors physically, I don’t wanna have to do it one at a time, so I always set it up by using which one the dGPU will treat as primary.
Hence why I’m looking for something that I can just run in one go and not have to manually tweak for each hardware.
There is no way for the OS to know, for a multi-monitor setup, which monitor(s) is in which position(s) (–right-of, --left-of, --above, --below) relative to the “primary” monitor.
You must provide that manually.
You could configure each machine once with a custom config file specifying the layout arrangement that xrandr manages (i.e. saving the actual xrandr command as a one-liner in that config file) then specify that as a systemd target to be run at boot.
I don’t know enough to tell you which systemd “service” needs the “target” file specification to contain a pointer to execute that config command.
You might also want to glance at the following pages:
For what it’s worth, some years ago I had an issue with LightDM resolution of the login screen that I fixed by using xrandr invoked via one of LightDM’s *-setup-script settings, don’t remember which specific *-setup-script setting I used but I think it might have been greeter-setup-script in my case. However that was resolution issue and not dual monitors
The trick I normally do is to plug the primary monitor on the left-most, essentially where the BIOS would show itself first when multiple monitors are plugged in. Its normally enough for most people, unless they do a vertical monitor layout, then thats when I’d use xrandr (I did something similar once when I had a vertical monitor with SDDM).
I just want a quick and clean way to just “force reset to very default”. Right now, I end up just re-arranging the monitors physically just so that the screen where UEFI POSTs is the same as the primary monitor. Just seems to be the fastest since I won’t have to jump in and run an xrandr and try to determine which monitor is which.
I WISH I could do Wayland, and not worry about this (unsure with GDM, but my SDDM can be arranged without xrandr anymore), but the primary software we’re using doesn’t play nice with it.