Second monitor not displaying desktop on login

TheProf

Gold Member
Gold Supporter
Joined
Jun 15, 2021
Messages
219
Reaction score
193
Credits
2,027
Hello folks,

I have an odd issue with my config on EndeavourOS where upon login, sometimes, one of the two monitors, would just not display the desktop. I can fix it by either logging off and logging back in, or by going into the settings and disable/enable the monitor.

This does not happen often, but I do see it happening from time to time which is really annoying. I don't see any errors either when this happens.

I also want to mention that I noticed this happening when I modified the Xsetup config to disable the secondary monitor from displaying the login screen on boot. Basically what I did was use xrandr to detect where each monitor is connected and then use the --off command to disable it on login screen. This works really well, only I am now experiencing this issue from time to time.

I also performed a bunch of updates, etc... even reinstalled the OS at some point a while back to test it, but it made no difference. This seems like a bug to me, but I was just curious if anyone has experienced this before.

Has anyone come across this before?
 


f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,079
Reaction score
2,836
Credits
29,458
When that happens, what happens when you try to go to the other monitor which is not displaying the desktop? What you could try and to do to see if it helps, configure your display manager to run a script before login. First install arandr, then you set your monitors how you want them to be and save it with a name and make it executable. The default location is ~/.screenlayout/monitor-setup.sh , it will look something like this.
#!/bin/sh
xrandr --output DP-1 --primary --mode 2560x1440 -r 165 --pos 2560x0 --rotate normal --output DP-2 --mode 2560x1440 -r 165 --pos 0x0 --rotate normal --output HDMI-1 --off --output HDMI-2 --off
Then for example in the lightdm configuration you have this option in the configuration file.
Code:
#display-setup-script = Script to run when starting a greeter session (runs as root)
Uncomment it and place the location of your arandr script there, then restart your display manager or restart your system. I used to use this to have my monitors configure correctly when I was still using an Nvidia card. You may be using a different display manager but I would think other display managers should have a setting like that as well. I'm not sure what it is maybe for some reason it's not setting your monitors correctly when on login and then it not showing a desktop or anything. I have not had this issue before and and am not sure if it works but try it and see what happens.
 
OP
TheProf

TheProf

Gold Member
Gold Supporter
Joined
Jun 15, 2021
Messages
219
Reaction score
193
Credits
2,027
Thanks! I will try this.

To answer your question about what happens, basically, I can move windows to that other monitor as if it is active, but it is just a black screen where I cannot see anything. The odd part, is that in Display Settings, the monitor is detected, it is how I am able to enable/disable the monitor... but regardless, until I enable/disable or log off and log back in, all I see is a black screen. This mainly happens on the secondary monitor, but I've seen it happen on the primary monitor before as well.
 
OP
TheProf

TheProf

Gold Member
Gold Supporter
Joined
Jun 15, 2021
Messages
219
Reaction score
193
Credits
2,027
Then for example in the lightdm configuration you have this option in the configuration file.
Code:
#display-setup-script = Script to run when starting a greeter session (runs as root)

I am using SDDM instead of lightDM, would it be the same?
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,079
Reaction score
2,836
Credits
29,458
I'll install sddm and find out for you :)
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,079
Reaction score
2,836
Credits
29,458
I checked the default sddm configuration and I found this line.
Code:
# Path to a script to execute when starting the display server
DisplayCommand=/usr/share/sddm/scripts/Xsetup
So it seems that it does, the original file is an empy file so you could add your arandr output in there or you could replace it with the location of where you save the arandr script. If that doesn't work you can always replace sddm with lightdm, if you do be sure to install both lightdm and a lightdm greeter. So if it doesn't work with sddm and you decided to try lightdm install these two packages.
Code:
pacman -S lightdm lightdm-webkit2-greeter
systemctl enable lightdm
 
OP
TheProf

TheProf

Gold Member
Gold Supporter
Joined
Jun 15, 2021
Messages
219
Reaction score
193
Credits
2,027
I checked the default sddm configuration and I found this line.
Code:
# Path to a script to execute when starting the display server
DisplayCommand=/usr/share/sddm/scripts/Xsetup
So it seems that it does, the original file is an empy file so you could add your arandr output in there or you could replace it with the location of where you save the arandr script. If that doesn't work you can always replace sddm with lightdm, if you do be sure to install both lightdm and a lightdm greeter. So if it doesn't work with sddm and you decided to try lightdm install these two packages.
Code:
pacman -S lightdm lightdm-webkit2-greeter
systemctl enable lightdm

Thanks for doing this f33dm3bits! You didnt have to, but appreciate it! I will report back shortly after testing this out.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online

No members online now.

Latest posts

Top