You are not logged in.
So I've got a simple thing I'm trying to do which somehow seems incredibly complicated to implement.
I have a self-encrypting hard drive, such that when I boot from hibernate (I don't use suspend), I get prompted for my password. I also use xscreensaver to manage security when my laptop is awake, and lock the screen after 10 minutes/when I trigger it. However, if my laptop hibernates for more than 10 minutes, when I boot I have to provide my password both to unlock the hard drive, and to deactivate xscreensaver. This is mildly annoying, and I'd like to disable xscreensaver just before I hibernate, and reactivate it when I wake up from hibernate.
I use systemd to manage hibernation, and I've spent about a day trying to get this to work with systemd. Every path I try invariably leads to some issue that prevents things from working the way I want.
At this point I think the right solution is to have a user xscreensaver.service, which I deactivate with a unit in /etc/systemd/system (along the lines of the sleep hooks described in the archwiki) but for the life of me I can't get things working. I usually use startx to begin my xorg session, but trying a display manager (lightdm) hasn't made this easier. Any advice would be much appreciated.
Last edited by alex404 (2017-11-26 21:18:31)
Offline
I assume you tried the /usr/lib/systemd/system-sleep hooks? What exactly did you try and how does it fail? Did you consider that those hooks run as root and do not know whether and which X11 server to talk to and that you've to tell them?
Offline
Xscreensaver will activate after 10 minutes because it doesn't have a mechanism to detect if time shifted after (for example) a sleep cycle. Considering how fragile it is to continuously start and restart your locker (especially if it's done by a program like systemd), I suggest to contact Xscreensaver upstream or switch to a different locker like xautolock.
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
I did toy with scripts in /usr/lib/systemd/system-sleep, but I didn't like using runuser to launch xscreensaver, and I couldn't get it quite right. Anyway, I guess using systemd wasn't the right idea, and it turns out xautolock (with i3lock) does exactly what I need. Thanks for the advice.
Last edited by alex404 (2017-11-26 21:18:08)
Offline