Re: [dev] [ANNOUNCE] slock-1.3

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Sat, 13 Feb 2016 01:08:53 +0100

hiro wrote:
> - new: slock now allows to run any command after the screen has been
> locked, for
> example suspending to ram.
>
> how come you can't just run slock from a shell script instead?

Heyho hiro,

you don't know when the screen is locked, since slock does not fork itself. If
you want to run `echo` after the screen is unlocked, you can just do `slock;
echo`, and if you want to run it before the screen gets locked the other way
around. But there was no possibility to run something after the screen got
locked and while it is still locked. The s2ram example from the man page is a
good one:

If you run it beforehand, then the screen is at least visible for a moment after
resuming from sleep and in the worst case slock fails to start correctly and you
don't know that in advance. Running s2ram afterwards is obviously a stupid idea
as well and using a backgrounded `sleep 5; s2ram` before starting slock also is
kind of stupid if slock fails to start up correctly.

If you have a better solution, let me know, I would be happy to reduce code
complexity again by reverting that commit.

--Markus
Received on Sat Feb 13 2016 - 01:08:53 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 13 2016 - 01:12:17 CET