Discussion:
does 'xset(1) dpms 20' activate xidle(1) after 20sec?
Marcus Merighi
2018-11-27 13:32:50 UTC
Permalink
Hello,

does 'xset(1) dpms 20' activate xidle(1) after 20 seconds?

How to repeat:

$ xset dpms 20
$ xidle -timeout 180 &

With this I am locked out after 20 seconds, not 180.

I looked hard to make sure everything runs with default settings.

Just saying, maybe someone has time to reproduce.

Marcus
joshua stein
2018-11-27 17:12:33 UTC
Permalink
Post by Marcus Merighi
Hello,
does 'xset(1) dpms 20' activate xidle(1) after 20 seconds?
$ xset dpms 20
$ xidle -timeout 180 &
With this I am locked out after 20 seconds, not 180.
The DPMS event activates the X screensaver which generates an X
event that xidle is listening for. xidle then runs its specified
program (or defaults to xlock).
Marcus MERIGHI
2018-11-28 09:56:13 UTC
Permalink
Post by joshua stein
Post by Marcus Merighi
does 'xset(1) dpms 20' activate xidle(1) after 20 seconds?
$ xset dpms 20
$ xidle -timeout 180 &
With this I am locked out after 20 seconds, not 180.
The DPMS event activates the X screensaver which generates an X
event that xidle is listening for. xidle then runs its specified
program (or defaults to xlock).
Thanks for confirming and the explanation of the cause!

I know you are having piles of experience with OpenBSD on all sorts of
fancy hardware... what do you do for dimming the display and locking?

Marcus
Alexander Hall
2018-11-28 22:24:20 UTC
Permalink
Post by Marcus MERIGHI
Post by joshua stein
Post by Marcus Merighi
does 'xset(1) dpms 20' activate xidle(1) after 20 seconds?
$ xset dpms 20
$ xidle -timeout 180 &
With this I am locked out after 20 seconds, not 180.
The DPMS event activates the X screensaver which generates an X
event that xidle is listening for. xidle then runs its specified
program (or defaults to xlock).
Thanks for confirming and the explanation of the cause!
I know you are having piles of experience with OpenBSD on all sorts of
fancy hardware... what do you do for dimming the display and locking?
This is what I use to give myself a three second grace period between the
screen going blank and the lock kicking in. The scroll lock led was for
fun and cosmetics.

$ egrep '^xidle|^xlock' .Xresources
xidle.*.timeout: 300
xidle.*.delay: 99999
xlock.*.lockdelay: 3
xlock.*.startCmd: xset dpms 3; sleep 3; xset led named "Scroll Lock"
xlock.*.endCmd: xset -dpms; xset -led named "Scroll Lock"

I start xidle in my ~.xsession

/Alesxander
Marcus MERIGHI
2018-12-02 17:51:17 UTC
Permalink
Hello,
Post by Alexander Hall
Post by Marcus MERIGHI
Post by joshua stein
Post by Marcus Merighi
does 'xset(1) dpms 20' activate xidle(1) after 20 seconds?
$ xset dpms 20
$ xidle -timeout 180 &
With this I am locked out after 20 seconds, not 180.
The DPMS event activates the X screensaver which generates an X
event that xidle is listening for. xidle then runs its specified
program (or defaults to xlock).
Thanks for confirming and the explanation of the cause!
I know you are having piles of experience with OpenBSD on all sorts of
fancy hardware... what do you do for dimming the display and locking?
This is what I use to give myself a three second grace period between the
screen going blank and the lock kicking in. The scroll lock led was for
fun and cosmetics.
$ egrep '^xidle|^xlock' .Xresources
xidle.*.timeout: 300
xidle.*.delay: 99999
xlock.*.lockdelay: 3
xlock.*.startCmd: xset dpms 3; sleep 3; xset led named "Scroll Lock"
xlock.*.endCmd: xset -dpms; xset -led named "Scroll Lock"
I start xidle in my ~.xsession
especially "startCmd" with "xset dpms" was a precious hint!
xlock(1) always woke up my DPMS dimmed display, and it remained lit.
Not anymore, thank you!

But I had to return to xautolock(1), since xidle(1) does not play well
with my "xset dpms 20", as stated in the Subject:.

I dug through the code of xidle(1), but see no way of telling if it is
"xset dpms" running or the XScreenSaver(3) doing its thing.

But I found the reason why some DEBUG printf()s did not show up, below.

Thanks!

Marcus

Index: xidle.c
===================================================================
RCS file: /cvs/xenocara/app/xidle/xidle.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 xidle.c
--- xidle.c 6 Sep 2018 07:21:34 -0000 1.6
+++ xidle.c 29 Nov 2018 11:10:03 -0000
@@ -366,7 +366,9 @@ main(int argc, char **argv)
if (fd < 0)
err(1, _PATH_DEVNULL);
dup2(fd, STDIN_FILENO);
+#ifndef DEBUG
dup2(fd, STDOUT_FILENO);
+#endif
dup2(fd, STDERR_FILENO);
if (fd > 2)
close(fd);

Loading...