Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #180691
| 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-05-04 15:40 +0200 |
| Message-ID | <tDp97-43E-1@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> <tDjGp-p9-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Thu, May 4, 2017 at 2:27 AM, Felix Dietrich <felix.dietrich@sperrhaken. name> wrote: > 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? > Yeah, I realized this a day or two later, and am updating my process/documentation now; I'm instead running the rsync process as part of my autologin/getty systemd unit as an ExecStartPre just before launching agetty. That's a good catch about the "wipe_profile.sh" being writable by the user; I'll change that. Thanks for pointing that out. > > 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 thought about that at the time, but figure any button press would also entail a slight bit of mouse movement in 99.99% of the cases, but since you've done the work for me in finding the event number (thanks! ;-) ), I've now added it. Good idea! > > I like the usage of grep's "-q" switch; I had forgotten about it. > > -- > Felix Dietrich > > -- 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
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