Greeter prompt on a monitor turned off issue

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  

Hello @Jose Villani

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:

[Seat:*]
greeter-setup-script=/etc/lightdm/lightdm_xrandr.sh

Reboot or restart the display manager (sudo systemctl restart lightdm). The login screen

Did you get your keyboard issue resolved??

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?

I have not used lightdm for quite a spell, but I suppose it could be the case.

I just checked my notes and I was right on the /path/to/etc/lightdm, but this is over 3 years ago.

Do you have a /etc/X11/xorg.conf ?
If so can you show it here. :slight_smile:

$ cat /etc/X11/xorg.conf.d/*
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
EndSection
Section "Files"
  FontPath "/usr/share/fonts/msttcore"
EndSection
Section "Device"
    Identifier "AMDGPU"
    Driver "amdgpu"
    Option "Monitor-DisplayPort-0" "PrimaryMonitor"
EndSection

Section "Monitor"
    Identifier "PrimaryMonitor"
    Option "Primary" "true"
EndSection
Section "OutputClass"
    Identifier "AMDgpu"
    MatchDriver "amdgpu"
    Driver "amdgpu"
    Option "EnablePageFlip" "off"
    Option "TearFree" "false"
EndSection

Rebooting now, will try that:

root@shizuma:/etc/lightdm/lightdm.conf.d# ll
total 20K
drwxr-xr-x 2 root root 4,0K 28 jui 15:31 .
drwxr-xr-x 3 root root 4,0K 28 jui 14:57 ..
-rw-r--r-- 1 root root   87  7 mai 12:45 50-numlock.conf.disabled
-rw-r--r-- 1 root root   98 28 jui 15:31 55-init.conf
-rw-r--r-- 1 root root   61 28 jui 14:51 60-hdmi.conf.disabled
root@shizuma:/etc/lightdm/lightdm.conf.d# cat 55-init.conf 
[Seat:*]
greeter-session=lightdm-gtk-greeter
greeter-setup-script=/usr/local/sbin/monitor-init.sh
root@shizuma:/etc/lightdm/lightdm.conf.d# cat /usr/local/sbin/monitor-init.sh
#!/bin/sh
xrandr --output HDMI-A-0 --off
/usr/bin/numlockx on

Please try to add these three lines to “Device”

Option         "UseEDID" "FALSE"
Option         "UseEDIDFreqs" "FALSE"
Option         "ModeValidation" "AllowNonEdidModes"

It sounds like we need to make the driver to ignore or override the monitor’s EDID data.
A reboot will be needed.

Finally got it by regrouping the greeter-setup-script and applying settings to all 3 monitors:

$ ll /etc/lightdm/lightdm.conf.d/
total 20K
drwxr-xr-x 2 root root 4,0K 28 jui 15:31 .
drwxr-xr-x 3 root root 4,0K 28 jui 14:57 ..
-rw-r--r-- 1 root root   87  7 mai 12:45 50-numlock.conf.disabled
-rw-r--r-- 1 root root   98 28 jui 15:31 55-init.conf
-rw-r--r-- 1 root root   61 28 jui 14:51 60-hdmi.conf.disabled

shizuma@shizuma:~$ cat /etc/lightdm/lightdm.conf.d/55-init.conf 
[Seat:*]
greeter-session=lightdm-gtk-greeter
greeter-setup-script=/usr/local/sbin/monitor-init.sh

$ cat /usr/local/sbin/monitor-init.sh 
#!/bin/sh
bash /home/shizuma/bin/pc.sh
/usr/bin/numlockx on

$ cat bin/pc.sh 
#!/bin/bash
#pc
xrandr --output DisplayPort-0 --primary --mode 1920x1080 --pos 0x0 --rate 60.00 --rotate normal --output DisplayPort-1 --off --output HDMI-A-0 --off;python ~/bin/CDSPremote.py -c 90deg-D1.yml

An immense thank you for helping me getting on the track!

Good work @josevillani ! :sweat_smile:

I forget about those .yml fiiles. :slight_smile: