Score:0

Lockscreen on suspend (LightDM)

al flag

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.

Score:0
ru flag

I got the last one to start with changing Environment and ExecStart. I also don't know what the User=%I does, but you should check it out with systemctl status file.service.

[Unit]
Description=Turning light-locker on before sleep
Before=sleep.target

[Service]
Type=forking
Environment=XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
ExecStart=/usr/bin/dm-tool lock
ExecStartPost=/usr/bin/sleep 1

[Install]
WantedBy=sleep.target

As for the oddball lock screen, see if you can catch a snapshot of what's running using ps - either temporarily in the service or using Ctrl-Alt-F2/F7.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.