Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #180511

Re: How to Run a Command on Screensaver Activation, Only After User Interaction that Session?

From Kent West <westk@acu.edu>
Newsgroups linux.debian.user
Subject Re: How to Run a Command on Screensaver Activation, Only After User Interaction that Session?
Date 2017-04-27 18:20 +0200
Message-ID <tAUj8-338-29@gated-at.bofh.it> (permalink)
References <tAD8B-86K-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, Apr 26, 2017 at 4:52 PM, Kent West <westk@acu.edu> wrote:

> I'm trying to work on a home-grown kiosk using Jessie.
>
> I've got 90% of it done, but I need it to logout after a certain time of
> inactivity, but only after the computer has been used at least once since
> the last start of X (otherwise it'll just be in a slow loop of restarting
> X).
>
> In other words, something like:
>
> - boot into X
> - sit idly for 20 minutes, 2 hours, 3 days, whatever, screensaver running,
> until a guest comes up and uses the kiosk
> - The guest walks away from the kiosk
> - 2 minutes later the screensaver kicks in, and X restarts
>
> (It might also be nice to have a 15-second delay when the guest can awaken
> the screensaver, aborting the restart.)
>
> I'm having a really hard time figuring out how to do this. Any ideas?
>
> Thanks!
>
>
>
I think I've got the basic logic worked out, but I need some help with the
syntax.

In my .xinitrc, I have

export FRESH_X=TRUE

Then I want to have a script that sits and waits for a keypress or a mouse
activity; this is where I need the syntax help.

When that script sees keyboard or mouse activity, it will export
FRESH_X=FALSE

I'll configure the xscreensaver-command --watch to watch for the screen
saver to go BLANK, and when it does to check the status of FRESH_X ; if
FRESH_X is FALSE, and the screensaver activates, I can set a 10-second
time, check again to make sure the screensaver is still active, and then
run my logout.

But I need help with the syntax of checking for a keypress or mouse
activity. I've looked at xinput and xev and another tool something like
xenv, but I can't figure out the syntax in a bash if/then statement.

Any help would be appreciated.

Thanks!




-- 
Kent West                    <")))><
Westing Peacefully - http://kentwest.blogspot.com

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to Run a Command on Screensaver Activation, Only After User  Interaction that Session? Kent West <westk@acu.edu> - 2017-04-27 00:00 +0200
  Re: How to Run a Command on Screensaver Activation, Only After User  Interaction that Session? Kent West <westk@acu.edu> - 2017-04-27 18:20 +0200
    Re: How to Run a Command on Screensaver Activation, Only After User  Interaction that Session? Felix Dietrich <felix.dietrich@sperrhaken.name> - 2017-04-28 04:50 +0200
      Re: How to Run a Command on Screensaver Activation, Only After User  Interaction that Session? Kent West <westk@acu.edu> - 2017-04-29 16:20 +0200
        Re: How to Run a Command on Screensaver Activation, Only After User  Interaction that Session? Felix Dietrich <felix.dietrich@sperrhaken.name> - 2017-05-04 09:50 +0200
          Re: How to Run a Command on Screensaver Activation, Only After User  Interaction that Session? Kent West <westk@acu.edu> - 2017-05-04 15:40 +0200
            Re: How to Run a Command on Screensaver Activation, Only After User  Interaction that Session? David Wright <deblis@lionunicorn.co.uk> - 2017-05-04 16:10 +0200

csiph-web