Dear Xubuntu community,
Sorry for a long question but I spent some time trying to debug the issue. I want to comprehensively present actions I tried, and would also like to receive a canonical answer solving the problem.
I am Ubuntu/Xubuntu user for a couple of years already. I use Xubuntu on small low-spec machine. I am well satisfied, but it happens it cause a little bit more troubles than Ubuntu on the other machine.
I am now on 18.04 (freshly installed) but the same problem happened to me before on 14.04. I solved it by installing xscreenserver, this time it didn't help.
The problem is that when my laptop goes into lock screen (or maybe suspend but I always disable that in power management options so it shouldn't), then it is quite common that I am not able to login back to it. Screen stays black after opening lid and pressing a button.
Sometimes I just type my password in the black screen, hit enter, and it works, I am back, but it is not the rule. Definitely not the way to go, as I cannot be sure where I am exactly typing my password into.
When the problem happened I spent quite a lot of time going into tty1 and using
lynx to find a way to at least save my current work that I had open in tty7 session.
sudo -i loginctl unlock-sessions worked but not always. Still not a way to go...
Let me define expected behaviour I trying to achieve.
When I am closing the lid I would like to have my session locked and display switched off. When I open my lid (or eventually press a button too) I would like to see greeter so I can unlock my session. Locking screen should also work from a menu option, and then closing the lid should just switch off display. This is I believe the default I have on my Ubuntu.
I read about double locked screen and some other issues, it is pretty complex to understand what is actually happenning. From my current understand it is likely to be an issue of configuration for systemd-logind, lightdm, light-locker and xfce4-power-manager.
Tried to couple of things:
Laptop lid: "Lock screen" and "Switch off display"
sudo vim /etc/systemd/logind.conf #set: HandleLidSwitch=lock
sudo apt slick-greeter lightdm-settings sudo lightdm-settings
sudo apt python-gi light-locker-settings sudo light-locker-settings
xscreenserver because it didn't worked and I actually don't need an screen saver app, but a proper configuration of lock screen and greeter.
To understand and debug things I need to know how to check which locker app am I using? light-locker, xflock, something else? I don't want to hear what is the default one in my distro version, but how to check that, so answer will be useful in future releases. How to access logs of that app.
Similarly, which greeter app am I using? and how to access its logs.
Most importantly... How to achieve expected behaviour of lid close + lock screen + display switch off?