12

How can I set the location for the login screen with lightdm in a multi monitor setup.

If have two monitors (1920x1080) + (1920x1200) and currently after I boot the login is shown on the left (smaller) monitor. I would like to view it only on the right (bigger) monitor.

Switching the cables on the graphics card did not help, and I have already made the bigger screen my primary screen using xrandr:

xrandr --output DVI-1 --primary #big screen

After login my panel is on the primary screen but the login screen itself is shown on the other smaller screen. How can I configure lightdm to display the login only on the bigger screen.

1
  • I have the exact same issue. Can't find the X11 configuration for LightDM
    – Ben Orozco
    May 22, 2014 at 23:49

3 Answers 3

11

At least with Ubuntu 16.04, which includes lightdm-gtk-greeeter 2.0.1, the following entry in /etc/lightdm/lightdm-gtk-greeter.conf can be used to fix the initial position of the login dialog on a certain monitor:

[greeter]
active-monitor=0

The xrandr workaround didn't work here, too.

3
  • 3
    It's probably important to note that the monitor number 0 is the left most monitor and not whichever is set to "primary". For example, on my triple monitor system where my center monitor is set to "primary" with XRandR, it seems I need to set active-monitor to 1.
    – Octopus
    Jul 12, 2017 at 17:00
  • Interestingly active-monitor can be a semicolon separated list. Use the value #cursor to display the login dialog on the screen with cursor. Nov 28, 2021 at 12:39
  • #cursor works indeed as expected. But I didn't see any difference using 0;1; what's the list supposed to do?
    – Murphy
    Sep 10, 2022 at 16:41
5

This did the trick for me. Find out your primary screen:

$ xrandr

And create the file /usr/bin/dualmon.sh with the following command:

xrandr --output DVI-0 --primary

**Change DVI-0 for your primary screen.*

Make it executable:

sudo chmod +x /usr/bin/dualmon.sh.

And add it to /etc/lightdm/lightdm.conf file:

[SeatDefaults]
display-setup-script=/usr/bin/dualmon.sh
session-setup-script=/usr/bin/dualmon.sh

Regards!

1
  • 2
    No need to create a script, simply write the command direct in to the config file.
    – coxe87b
    Apr 19, 2020 at 2:03
1

Once you find out your screen identifier as Ben suggested using xrandr then you can pick your desired display output (mine was called HDMI-1) and enter it direct in to the config file.

/etc/lightdm/lightdm.conf

Search for the line "display-setup-script" and change it to read:

display-setup-script=xrandr --output HDMI-1 --primary

Obviously replacing "HDMI-1" with your desired monitor, eg. "DVI-1" or "DP-1" for DVI or DisplayPort if not HDMI.

I currently use lightdm-webkit2-greeter so I don't have this option, but if you use the lightdm-gtk-greeter then you can do the following instead:

[greeter]
active-monitor=0

In the file /etc/lightdm/lightdm-gtk-greeter.conf

1
  • Thanks, good to know I don't need to create a separate script file for this. Apr 7, 2023 at 17:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .