You are not logged in.

#1 2021-10-10 15:38:49

kflak
Member
Registered: 2017-09-23
Posts: 46

Lock on lid close/suspend fails

Hi,

When resuming my thinkpad t480s from suspend the screen lock kicks in after ca. 5 seconds if I use xss-lock. If I use systemd like this:

/etc/systemd/system/lidlock.service
---
[Unit]
Description=Lock screen on resume from suspend
Before=sleep.target

[Service]
User=kf
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/slock
ExecStartPost=/usr/bin/sleep 1

[Install]
WantedBy=sleep.target

the systemd service fails with this output from `journalctl -xeu lidlock.service`:

Oct 10 18:27:43 t480s systemd[1]: lidlock.service: start operation timed out. Terminating.
Oct 10 18:27:43 t480s systemd[1]: lidlock.service: Failed with result 'timeout'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit lidlock.service has entered the 'failed' state with result 'timeout'.
Oct 10 18:27:43 t480s systemd[1]: Failed to start Lock screen on resume from suspend.
░░ Subject: A start job for unit lidlock.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit lidlock.service has finished with a failure.
░░
░░ The job identifier is 20123 and the job result is failed.

This happens on both i3 and bspwm. If I run the screen locker from swayidle, this is no problem. I start the locker from bspwmrc, but starting it from xinit leads to the same result. I tried installing acpid, but this seems to have no effect.

[edit] If I omit

Type=forking

from the systemd service file, I get the same behavior as when I run xss-lock.

[edit 2] Seems the problem was connected with a systemd-service file that restarts picom on sleep! Installed this a while ago, as I had some issues that the laptop wouldn't wake up after sleep. Will try with this configuration for a while, hopefully it won't mess up my wakeup!

[edit 3] My jubilations were unfortunately premature. The removal of the picom-restart.service does not solve the problem. I am at a total loss here...

Last edited by kflak (2021-10-11 04:13:14)

Offline

Board footer

Powered by FluxBB