Display Manager multi-monitor configuration

When having multple monitors on system boot, your Display Manager (SDDM, LightDM, GDM etc) will usually not display correctly in respect to your configured Xorg settings, if not configured properly.
To fix this, a popular and fairly proper and easy method is to use an Xsetup script for your Display Manager.

Xsetup script is a script (executable) file that includes some instructions to the Xorg server, just before starting the Display Manager

Here arre these settings for SDDM, while they can be adapted/adjusted easily for other DMs.

Create Xsetup script

Create a text file as


and make it executable.
Paste these contents and save.

The example is for two monitors, checking if one is not connected and applying relevant settings with xrandr command. You should edit these commands, according to your own actual setup.

# get the correct actual monitor names with
# xrandr | awk ' /connected/ { print $1, $2 }'
# wait 3
if xrandr | grep "$mon2 disconnected"; then
    xrandr --output "$mon2" --off --output "$mon1" --auto
elif xrandr | grep "$mon1 disconnected"; then
    xrandr --output "$mon1" --off --output "$mon2" --auto
    xrandr --output "$mon1" --auto --output "$mon2" --right-of "$mon1" --auto

Add custom SDDM sddm setting snippet

Create a file as


with the following contents

# Path to a script to execute when starting the display server

Now you are ready to restart your Display Manager to see the results.
Log out your session, or you will see it at your next boot.