Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

Delayed screenlock on wake up #20

Open
ghost opened this issue Sep 28, 2017 · 5 comments
Open

Delayed screenlock on wake up #20

ghost opened this issue Sep 28, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 28, 2017

I'm using a Lenovo Thinkpad X200 w/ Arch. I installed this via AUR and started and enabled the service you suggested in you README to run sxlock when the pc goes in sleep/hibernation mode and it worked but there is a sensible delay when I wake up the pc. You can literally see the unlocked screen for like 2 seconds and only then the black screen of sxlock appears running as usual thanks to the previously set service. Is this a problem on my end?

@lahwaacz
Copy link
Owner

Does adding Before=sleep.target to the [Unit] section help?

@ghost
Copy link
Author

ghost commented Sep 29, 2017 via email

@lahwaacz
Copy link
Owner

lahwaacz commented Oct 1, 2017

Have you run systemctl daemon-reload after editing the service? Do you have other services bound to the sleep/suspend/hibernate targets? Does using Before=suspend.target or Before=hibernate.target instead of the sleep.target help? It has to work somehow. There are also some examples here. Maybe use ExecStartPost=/usr/bin/sleep 1 or something like that as a workaround?

Writing a script won't help because sxlock does not fork itself, it has to keep running in foreground until you unlock the screen. Or maybe the lack of notification to the parent process when the screen is actually locked is the problem. There are delays to grab the keyboard and pointer, but I don't see how that could get into seconds...

@ghost
Copy link
Author

ghost commented Oct 11, 2017

Sorry if I reply this late. I tried all the three methods (sleep, suspend, hibernate) and they didn't work. The ExecStartPost didn't work either. I was talking about a script because I can rebind the key that put the pc in sleep mode and redirect to a script that first start sxlock and only then run the command to put the pc in sleep mode

@limitedAtonement
Copy link
Contributor

The way this looks on my system is that the screen flickers perhaps 4 times on wakeup showing the unlocked screen then black alternating before showing the lock screen. My guess is that the graphics card is showing "uninitialized" memory...a different buffer that still has the unlocked desktop on it? I'm thinking the desktop environment (xfce in this case) should take care of clearing graphical memory before going to sleep or before calling the lack command.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants