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


Groups > linux.debian.user > #180683

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

From Felix Dietrich <felix.dietrich@sperrhaken.name>
Newsgroups linux.debian.user
Subject Re: How to Run a Command on Screensaver Activation, Only After User Interaction that Session?
Date 2017-05-04 09:50 +0200
Message-ID <tDjGp-p9-13@gated-at.bofh.it> (permalink)
References <tAD8B-86K-5@gated-at.bofh.it> <tAUj8-338-29@gated-at.bofh.it> <tB48O-1hm-9@gated-at.bofh.it> <tBBo5-7iD-11@gated-at.bofh.it>
Organization solani.org

Show all headers | View raw


Kent West <westk@acu.edu> writes:

> On Thu, Apr 27, 2017 at 9:27 PM, Felix Dietrich
> <felix.dietrich@sperrhaken.name> wrote:
>
>     Kent West <westk@acu.edu> writes:
>
> What I needed (and have since solved - below) was help working out the
> syntax of determining human interaction with X.
>
>     You may also want to consider that a user probably should not be
>     able to
>     edit the initialisation script (xinitrc)
>
> In my current setup, the current user can do either of these things,
> but not permanently; his changes are lost upon a restart of X, so the
> changing of .xinitrc is a non-issue.

If the user chooses to overwrite the .xinitrc file the rsync command you
use to reset the home directory at the beginning of that script (as part
of wipe_profile.sh) will not be run.  Maybe you should reset the home
directory at the end of the session (and also as part of the
initialisation during boot in case of a sudden power loss).
wipe_profile.sh also appears to be writeable by the user?

> The problem is that xinput reports several EVENTs on startup of the
> utility, so I had to figure out a way to do finer-grained testing. My
> solution is below.
>
> xinput test-xi2 --root | egrep -q "EVENT type 2|EVENT type 6"

Event 2 is the KeyPress event, Event 6 is the MotionNotify event.  Maybe
you should check for the ButtonPress event 4 as well to handle mouse
clicks?  I found the events listed in "/usr/include/X11/X.h", which you
can find as part of the x11proto-core-dev package.

I like the usage of grep's "-q" switch; I had forgotten about it.

--
Felix Dietrich

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