You are not logged in.

#1 2013-08-13 20:50:06

polson136
Member
Registered: 2012-03-03
Posts: 39

Screen lock using systemd-logind

I noticed that in loginctl there is an option to unlock/lock sessions, and also trigger a lock on ACPI events. On my system, this is not working. I want xscreensaver to actually perform the lock. Any ideas?

Offline

#2 2013-08-13 22:13:15

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,148

Re: Screen lock using systemd-logind

What isn't working? That is, what did you try?

How isn't it working? That is, what happened? What error did you get? What's in the logs/journal?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-08-14 02:13:56

polson136
Member
Registered: 2012-03-03
Posts: 39

Re: Screen lock using systemd-logind

When I run:

sudo loginctl lock-session 1 (or whatever session id is appropriate)

The command returns, and I get a shell prompt, but absolutely nothing happens. I get the same result whether the corresponding session is graphical or on a virtual terminal. If there is an actual error, I haven't found it. I haven't found any relevant logs in /var/log.

Offline

#4 2013-08-14 10:51:02

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Screen lock using systemd-logind

Something needs to listen to systemd-logind's dbus signals for this to work. xscreensaver doesn't do that. I'm pretty sure the big DEs have a component that does this by now and I have written xss-lock to replace xautolock with something that supports systemd (and X screen saver events) for the more lightweight environment that I use.

xscreensaver does not work with the X screen saver extension and does its own polling so you would not typically use it with xautolock/xss-lock. Maybe you could run xss-lock just to connect logind signals to xscreensaver. That means turning off the idle/inactivity events generated by the X server (if you haven't already done that for xscreensaver):

$ xss-lock -- xscreensaver-command -lock &
$ xset s off

I have not tested this and it may require some more tweaking.

Last edited by Raynman (2013-08-14 11:03:23)

Offline

#5 2013-08-15 00:06:23

polson136
Member
Registered: 2012-03-03
Posts: 39

Re: Screen lock using systemd-logind

Finally, an answer as to why this isn't working. This sounds intriguing, and I don't mind a little tweaking, or just ditching xscreensaver entirely. I would try it right now, but it appears that all of the download links on bitbucket required to build the aur package are broken. Is there a way this can be fixed, or do I have to work with the repository directly?

Offline

#6 2013-08-15 10:39:36

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Screen lock using systemd-logind

I can't find anything that needs fixing. The "Sources" link on the AUR page gets me the tarball and rebuilding the package also works. Perhaps it was a temporary issue with bitbucket?

Offline

#7 2013-08-15 14:17:03

polson136
Member
Registered: 2012-03-03
Posts: 39

Re: Screen lock using systemd-logind

All working fine now. BitBucket must have been down.

Yes, this appears to be what I was looking for. Thanks. I will now be able to make good use of the laptop's lid switch.

Offline

Board footer

Powered by FluxBB