On a workstation with cinnamon as desktop and lightdm, I have a 3 monitors setup. The main monitor is OK, no problem there.
The 2nd monitor is hdmi and turned off (it has a real on/off switch).
The 3rd monitor has no issue either.
The problem:
The greeter thinks it’s a dual monitor setup ans displays its login prompt on the 2nd monitor (hdmi) which is turned off. I know the login prompt is there, so I can blindly type my login credentials and wait for the desktop to appear on the 1st monitor. The dual monitor setup remains, so I use xrandr to set it to single.
What I’d want is the greeter thinks it’s a single monitor setup, and displays its prompt on the 1st monitor, and forget everything about the 2nd.
$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DisplayPort-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
1920x1080 60.00*+ 50.00 59.94
1680x1050 59.95
1280x1024 60.02
1440x900 59.89
1280x720 60.00 50.00 59.94
1024x768 60.00
800x600 60.32
720x576 50.00
720x480 60.00 59.94
640x480 66.67 60.00 59.94
720x400 70.08
HDMI-A-0 connected (normal left inverted right x axis y axis)
1920x1080 60.00 + 50.00 59.94
1680x1050 59.88
1280x1024 75.02 72.05 60.02
1440x900 59.90
1152x864 75.00
1280x720 60.00 50.00 59.94
1024x768 75.03 70.07 60.00
800x600 72.19 75.00 60.32
720x576 50.00
720x480 60.00 59.94
640x480 75.00 72.81 66.67 60.00 59.94
720x400 70.08
1728x972_60.00 59.90
DisplayPort-1 connected (normal left inverted right x axis y axis)
1920x1080 60.00 + 74.97
1680x1050 59.95
1280x1024 75.02 60.02
1440x900 59.89
1280x960 60.00
1280x800 59.81
1152x864 75.00
1280x720 60.00
1024x768 75.03 70.07 60.00
832x624 74.55
800x600 72.19 75.00 60.32 56.25
640x480 75.00 72.81 66.67 59.94
720x400 70.08
Identify your Monitor Names Run xrandr | grep -w connected
My example is:
xrandr | grep -w connected
HDMI-A-1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 575mm x 323mm
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
So if my memory serves me correct, this should help:
I first set or Create a script to turn off the secondary display before the greeter loads. Save this as /etc/lightdm/lightdm_xrandr.sh:
#!/bin/sh
# Replace HDMI-1 with your actual secondary monitor name from xrandr
xrandr --output HDMI-1 --off
The Device has to match your setup and save it as /etc/lightdm/lightdm_xrandr.sh:
Make the script executable:
sudo chmod +x /etc/lightdm/lightdm_xrandr.sh
Now I edit /etc/lightdm/lightdm.conf or a drop-in file in /etc/lightdm/lightdm.conf.d/ This is where my mind is a bit fuzzy :() But add the following under the [Seat:*] section:
Thanks for the quick reply.
Will test that at the next reboot.
Still working on the keyboard issue, recompiling trakes a lot of time. Might be my 5th tentative to implement key debouncing. Still not working, but now I know how to recompile properly.
Unfortunately, that didn’t solve the issue. The 2nd monitor is indeed off as I wanted, but the login prompt is nowhere to be found. So I commented out the modification for the time a solution is found.
Actual setup:
$ cat /etc/lightdm/lightdm.conf.d/*
[Seat:*]
greeter-session=lightdm-gtk-greeter
greeter-setup-script=/usr/bin/numlockx on
[Seat:*]
greeter-setup-script=/etc/lightdm/lightdm_xrandr.sh
shizuma@shizuma:~$ cat /etc/lightdm/lightdm_xrandr.sh
#!/bin/sh
# Replace HDMI-1 with your actual secondary monitor name from xrandr
#xrandr --output HDMI-A-0 --off
shizuma@shizuma:~$ ll /etc/lightdm/lightdm.conf.d/*
-rw-r--r-- 1 root root 87 7 mai 12:45 /etc/lightdm/lightdm.conf.d/50-numlock.conf
-rw-r--r-- 1 root root 61 28 jui 14:51 /etc/lightdm/lightdm.conf.d/60-hdmi.conf
Could it be there is 2 greeter-setup-script lines? one for the numlock and another for the hdmi?