Currently I'm using LightDM with the lightdm-webkit2-greeter and multiple WM/DM's.
I3, AwesomeWM, Gnome and KDE
My problem is that on auto suspend or closing my laptop lid the screen either wont lock when using gnome, or that I will get a different lock screen which I'm unable to identify.
I know that LightDM has some problems with locking your screen on suspend but there has to be a way?
My first question is, what kind of Lock screen Am I looking at?
The Lockscreen in question
Sorry for the phone picture, I was unable to make a screenshot
The second one would be, how can I make LightDM lock my screen on suspend or closing my laptop?
I already tried to create a service with systemd but that doesn't work for me, here is the script anyways:
Actually I tried 3 different ones I found on the web, but none of them works.
First one
[Unit]
Description=Lock screen when waking up
[Service]
User=%I
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/dm-tool lock
[Install]
WantedBy=sleep.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
Second
[Unit]
Description=Turning i3lock on before sleep
Before=sleep.target
[Service]
User=%I
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/dm-tool lock
ExecStartPost=/usr/bin/sleep 1
[Install]
WantedBy=sleep.target
And the third one
[Unit]
Description=Turning light-locker on before sleep
Before=sleep.target
[Service]
User=%I
Type=forking
Enviroment=XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
ExecSart=/usr/bin/dm-tool lock
ExecStartPost=/usr/bin/sleep 1
[Install]
WantedBy=sleep.target
I'm sorry if I'm missing something trivial, but i never worked with services before
And just to clear it up, yes I enabled and started them with systemd
sudo systemctl enable xyz.service
I might need to mention that I use a program called howdy to unlock my laptop with my face, I had the problem before, but I'm unsure if it might affect a solution in any way.
Locking the screen manual with dm-tool or light-locker works.