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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Marcus MERIGHI
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

Reply | Threaded
Open this post in threaded view
|

Re: does 'xset(1) dpms 20' activate xidle(1) after 20sec?

joshua stein-3
On Tue, 27 Nov 2018 at 14:32:50 +0100, Marcus Merighi wrote:

> 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.

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).

Reply | Threaded
Open this post in threaded view
|

Re: does 'xset(1) dpms 20' activate xidle(1) after 20sec?

Marcus MERIGHI
[hidden email] (joshua stein), 2018.11.27 (Tue) 18:12 (CET):

> On Tue, 27 Nov 2018 at 14:32:50 +0100, Marcus Merighi wrote:
> > 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.
>
> 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

Reply | Threaded
Open this post in threaded view
|

Re: does 'xset(1) dpms 20' activate xidle(1) after 20sec?

Alexander Hall
On Wed, Nov 28, 2018 at 10:56:13AM +0100, Marcus MERIGHI wrote:

> [hidden email] (joshua stein), 2018.11.27 (Tue) 18:12 (CET):
> > On Tue, 27 Nov 2018 at 14:32:50 +0100, Marcus Merighi wrote:
> > > 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.
> >
> > 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

Reply | Threaded
Open this post in threaded view
|

Re: does 'xset(1) dpms 20' activate xidle(1) after 20sec?

Marcus MERIGHI
Hello,

[hidden email] (Alexander Hall), 2018.11.28 (Wed) 23:24 (CET):

> On Wed, Nov 28, 2018 at 10:56:13AM +0100, Marcus MERIGHI wrote:
> > [hidden email] (joshua stein), 2018.11.27 (Tue) 18:12 (CET):
> > > On Tue, 27 Nov 2018 at 14:32:50 +0100, Marcus Merighi wrote:
> > > > 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.
> > >
> > > 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);