If I lock the screen, hibernate by closing the laptop lid, open the laptop lid and press the power button, the screen will just show a black surface and I can start typing the password immediately. If I don't lock the screen before hibernating, wait about 30s, open the laptop lid and press the power button, the screen will show the desktop and then fade to black as if xscreensaver had been activated after exiting hibernation. Only after the fadeout can I deactivate the screensaver. How can I make sure xscreensaver is always properly activated when hibernating, so that I won't have to wait for the fadeout?
Asked
Active
Viewed 7,740 times
20
l0b0
- 50,672
- 41
- 197
- 360
-
I don't use `xscreensaver` anymore, but I remember [its manual](http://linuxcommand.org/man_pages/xscreensaver1.html) has a part called "restart xscreensaver when someone logs in", which suggests doing `xscreensaver-command -exit; xscreensaver &` on login. Maybe you could do that on wake-up to reset its state? – Anko - inactive in protest Jul 16 '14 at 11:45
-
1That sounds like a timing attack waiting to happen. – l0b0 Jul 16 '14 at 13:54
-
This one of those little perks that bug me more than they should. – arielnmz Jul 27 '14 at 02:35
3 Answers
6
I recently solved this problem myself on Arch Linux. I used the program xss-lock from the AUR found here.
I was trying to set up a service to lock the screen on sleep but for some reason I couldn't get it to work. I ended up using xss-lock and it worked very easily.
- Install xss-lock from the AUR.
- Add one of the commands below to your
.xprofileor appropriate startup script for your WM/DM.
My .xprofile:
xss-lock -- /usr/bin/slock &
For xscreensaver:
xss-lock -- /usr/bin/xscreensaver-command -lock &
David Gardner
- 446
- 4
- 13
JKav77
- 161
- 2
- 8
-
xss-lock apparently moved to [xss-lock-git](https://aur.archlinux.org/packages/xss-lock-git/) – felipeduque Apr 22 '19 at 22:11
1
I solved this problem for myself by switching to a dedicated screen locker instead of xscreensaver.
I use xtrlock on Debian, but it seems to be unavailable on Arch. Here's a blog post describing some of the alternatives on Arch.
Nidal
- 8,856
- 11
- 55
- 74
Jaap Joris Vens
- 833
- 6
- 19
0
Almost fixed using xautolock with slock and a simple screen locking service. The service currently only works on the system level, but hopefully someone will be able to help with that.
l0b0
- 50,672
- 41
- 197
- 360