Xfce Forum

Sub domains

You are not logged in.

#1 2021-06-25 19:56:28

From: UK
Registered: 2021-06-25
Posts: 2

External Monitor not detected after Login

Hi everyone,

Let me explain my situation.


OS: Arch-linux
DE: xfce4
DM: lightdm with lightdm-gtk-greeter
Laptop: T440p no dGPU
Docking station: yes (Lenovo)
External screen: ASUS VG27WQ ASUS 27" 2560*1440 (qHD) connected on Docking Station via displayport.
xfce4-display-settings: I created a profile where I disable the laptop screen and enable the "Configure new displays when connected" and "Automatically enable profiles when new display is connected" options.
Use cases:

  1. Laptop alone

  2. Laptop on dock with lid open

  3. Laptop on dock with lid open and external monitor

  4. Laptop on dock with lid closed and external monitor

There is no problem for use cases a. and b. as LighDM display the login screen on the laptop.
Cases c. and d. are were problems start.

Case d. description

If I start the laptop when it is docked on the station with the lid closed and my external monitor plugged in.
I will see the Bios splashscreen and the grub selection screen on my external monitor.
Then the external screen goes black and will idle on the login screen.
If I enter my credentials, the screen will stay black. I checked and my laptop screen is on during the process and the external monitor is not detected.
I will need to power off and on again the external monitor. Then when the monitor power-up, the display will go to the external monitor and the laptop screen will switch-off.

There are two problems:

  1. The external monitor is not used on the login screen. (case d)

  2. After login, I have to switch on and off the external monitor for it to be detected and used. (cases c and d)

I searched a solution for my first issue assuming it would fix the second one.
I found that: https://askubuntu.com/questions/119843/ … or-lightdm
Where I need to install xorg-xrandr and run a script to detect the monitor and select the correct setting.
However, that means I also need to detect when the laptop is docked, with the lid closed and with an external monitor.
So far I just get black screen on my external monitor. No x session is started.

Also, is there a way to force the external monitor detection?

Thanks for any insight you could share with me,


Extra informations

In my /etc/lightdm/lightdm.conf


In /usr/share/lightdmxrandr.sh

# Modified for Asus VG27WQ (2560x1440) external on DP2 or DP1

XGREPDP21="xrandr -q | grep 'DP2-1 connected'"
XOPENDP21="xrandr --output DP2-1 --primary --auto --output eDP1 --auto --left-of DP2-1"
XCLOSEDP21="xrandr --output DP2-1 --primary --auto"
XCOMEDP1="xrandr --output eDP1 --primary --auto"
XOFFEDP1="xrandr --output eDP1 --off"

LIDSTATE="grep 'closed' /proc/acpi/button/lid/LID/state"

# if [ -z "$LIDSTATE" ]
if [ -n "$LIDSTATE" ] || [ ! "$LIDSTATE" = "" ];
    echo "Lid closed"
	# Lid is closed, disable laptop screen and detect if there is an external monitor.
	eval $XOFFEDP1
	if [ -n "$XGREPDP21" ] || [ ! "$XGREPDP21" = "" ];
            echo "DP2-1 connected"
        	# if the external monitor is connected, then we tell XRANDR to use it as primary
        	eval $XCLOSEDP21
    echo "Lid opened"
	# Lid is opened, detect if external monitor.
	if [ -n "$XGREPDP21" ] || [ ! "$XGREPDP21" = "" ];
            echo "DP2-1 connected"
        	# if the external monitor is connected, then we tell XRANDR to set up an extended desktop
        	eval $XOPENDP21
            echo "No external display connected"
	       	# lid is opened, use laptop screen then
       		eval $XCOMEDP1
exit 0;


Board footer

Powered by FluxBB