Login screen always opens on external monitor

I have two monitors attached to my nvidia card. To run them both, I had to run both on nvidia card. But I am running into another problem. When I start my laptop, the primary display starts until it reaches the login screen. The login screen is then switched to my external display while the laptop goes blank. After logging in, both monitors start working. This creates a problem when the external monitor is disconnected. The login screen doesn’t appear even then on the laptop, and I am not able to login. Is there a way to shift the login screen to my laptop display?

I am running i3wm with light-dm.

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm
   1920x1080     60.00*+  59.94    50.00    60.00    50.04    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1440x900      74.98    59.89  
   1400x1050     59.98  
   1360x768      60.02  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
   1920x1080     60.02*+  59.93  
   1680x1050     59.88  
   1400x1050     59.98  
   1600x900      60.00    59.95    59.82  
   1280x1024     60.02  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1368x768      60.00    59.88    59.85  
   1280x800      59.81    59.91  
   1280x720      59.86    60.00    59.74  
   1024x768      60.00  
   1024x576      60.00    59.90    59.82  
   960x540       60.00    59.63    59.82  
   800x600       60.32    56.25  
   864x486       60.00    59.92    59.57  
   640x480       59.94  
   720x405       59.51    60.00    58.99  
   640x360       59.84    59.32    60.00  

Hi @kramer,

In order for us, or anyone for that matter, to be able to provide assistance, more information is necessary. To that end, please see:

Hope you manage!


To provide terminal output, copy the text you wish to share, and paste it here, surrounded by three (3) backticks, a.k.a grave accents. Like this:


pasted text


This will just cause it to be rendered like this:

Portaest sed
cursus nisl nisi
hendrerit ac quis
tortor sit leo commodo.

Instead of like this:

Portaest sed elementum cursus nisl nisi hendrerit ac quis sit adipiscing tortor sit leo commodo.

Thereby improving legibility and making it much easier for those trying to be of assistance.

Please edit your post accordingly.

I’ve got a feeling you’d have to change the primary display, but I might be wrong. Check with

man xrandr


xrandr --help

updated. xrandr has laptop as primary

hello @kramer

i found something interesting but i never tested it myself but it might be interesting for your needs:

you can install it from the official repositories in the package-manager (no need to install from github)


Will try this. For now, is there a way I can shift the login screen to primary?
Here is my xorg:

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"

Section "Device"
    Identifier     "Device0"
    VendorName     "NVIDIA Corporation"
    ChipId          0x0
    ChipRev         0x0
    IRQ             0

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24

Not sure if this help:



Section "Device"
        Identifier "Nvidia Card"
        Driver     "nvidia"
        VendorName "NVIDIA Corporation"
        BoardName  "GeForce GTX 1050 Ti"

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    Option         "MetaModes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
    Option         "AllowIndirectGLXProtocol" "off"
    Option         "TripleBuffer" "on"

this autodetect seems to fit the needs. you can define different settings, as example mobile and stationary and the settings will swap automatically.

Checking it our rn

I am getting errors while trying to switch to integrated graphics(only laptop). and also when trying to switch from laptop to nvidia.

autorandr -c laptop
Failed to apply profile 'laptop' (line 860):
  New profile configures output eDP-1 which does not exist in current xrandr --verbose output. Don't know how to proceed. (line 860)

I tried logging in through terminal and then starting X server, this doesn’t work also.

is there a minus too much ? xrandr shows “eDP1” but the error is naming a “eDP-1”. Maybe there is a minus too much in your setup.

Yes, it should be eDP1. Changed the config file, and it worked from terminal. Now let me check the auto mode when the monitor is disconnected.

Edit: Checked, doesn’t work automatically. I think the main issue is with optimus which is not able to switch to integrated even when told to boot in integrated mode

that’s propably the issue. may you post your last config file so i can use it as example ? i will check optimus-manager and the autorandr but i need some days because i’m busy. propably it’s the solution to switch not in grub but in /etc/optimus-manager/optimus-manager.conf as described here.

in this case the grub has also be reedited and the two entries for nvidia must be deleted and grub must be updated. i’ll try it but please post the output of the last config and the path where it is stored.

Which config should I post?

> etc/optimus-manager/optimus-manager.conf




hello @kramer ,
it’s okay, this is a interesting theme and i’ll check this autorandr in the following days and also if there are other options to change the displays at login. but it takes 2-3 days cause i’m busy with other problems actually.

1 Like

No problem. At your convenience.