SUMMARY: Finding idle time for auto xlock

From: Andrew Beckett (abeckett@fmlrnd.co.uk)
Date: Fri Jun 03 1994 - 04:59:46 CDT


Original question:
> Dear sun-managers,
>
> To try to improve our security just a little bit, I have been trying to
> find a way to automatically run xlock on a machine when it has been "idle"
> for a certain period of time, in the same way that screenblank blanks the
> screen. The problem is that I can't find an appropriate system call or
> ioctl which will tell me this sort of information. Obviously it must be
> possible because screenblank, finger and w return it (it appears that
> the idle time on the console will do - wiggling the mouse seems to reset
> the idle time returned by finger).
>
> I've tried RTFM (including searches in Answerbook), including looking
> at kb and kbd drivers, but have so far drawn a blank.
>
> So I present two questions:
>
> 1. Is there any PD software out there which will do this?
> 2. Does anyone know how I can find out the idle time?
>
> Obviously I could get the server to run finger and look at the output, but
> that seems a rather tacky way of doing it to me!!
>

The answers:

1.
   xautolock (the most popular reply)
   This runs your favourite locking program (xlock by default) after
   a specified period of inactivity (which it finds by some X trickery).
   This works on OpenWindows ok, and has cute features like being able to
   define a region in the corner of the screen where you can place your cursor
   to stop it from autolocking! Thanks to Jonathon Davis for sending me this,
   although it's available from your local archie.

   xscreensaver (mentioned by a few)
   This is a complete screen locking program with lots of different
   different patterns. Turned out that our Manchester site already had
   this (Thanks Ian). You can set a time for inactivity before it runs.
   However, it needs Motif libraries which don't normally come with OpenWindows,
   so be warned. It can also handle the XIdle feature of X11R5 (not in
   OpenWindows).

   xlocktool (mentioned by two)
   Supposedly this is pretty good, but I haven't seen it.

2.
   I'd actually worked out how to do this before any replies came.
   The answer is to use stat (2V) to find the access time on /dev/kbd
   and /dev/mouse & then subtract this from the current time, etc.
   Several sent me scripts or code fragments to do this, but it's pretty
   straightforward.

Thanks to:

"Brian Decker" <bdd@melpar.esys.com>
"Frank 'Scruffy' Miller" <Frank.Miller@master.cna.tek.com>
Brad Burdick <bburdick@radio.com>
Christian Lawrence <cal@soac.bellcore.com>
Dan Stromberg - OAC-DCS <strombrg@hydra.acs.uci.edu>
Gareth J McAleese <G.McAleese@ulst.ac.uk>
Gary.Richardson@proteon.com (Gary Richardson)
James T Perkins <jamesp@sp-eug.com>
John DiMarco <jdd@db.toronto.edu>
Jonathan C. Davis <Jonathan.C.Davis@acenet.auburn.edu>
Markus Storm <storm@uni-paderborn.de>
Mike Raffety <mike_raffety@il.us.swissbank.com>
Pat Cain - Denver <pjc@denver.ssds.com>
Ric Anderson <ric@Artisoft.COM>
Steve Swaney <swanes@etswwmd.eq.gs.com>
Tim Rosmus <tim@mdd.comm.mot.com>
Zuercher.Werner@ch.swissbank.com (Werner Zuercher)
abeckett@fmlrnd.co.uk (Andrew Beckett)
adamfox@super.org (Adam Fox)
antonson@umiacs.UMD.EDU (Todd S. Antonson)
camm@fmlrnd.co.uk (Ian Camm)
dhb@ssd.ray.com (David H. Brierley)
edk@mach10.utica1.kaman.com (Edward F Killian)
glenn@uniq.com.au (Glenn Satchell)
hbreeder@nl.oracle.com
ivory@tower.com (John E. Ivory)
javaid (Javaid Siddiqi)
javaid@lexmark.com (Javaid Siddiqi)
jtcummi@sandia.gov (Jeff Cummings)
kumeda@tds.com (Andy Kumeda)
lacoursj@uprc.com (Jeffrey D. LaCoursiere)
nino@well.ox.ac.uk (Nino Margetic)
reedv@rpi.edu (Vince Reed -- "Sub Zero" )
rr6204@moses.boeing.com (Bob Rutherford 965-0546)
russ@issi.com

***********************************************************************
* Andrew Beckett * *
* Senior Design Engineer * *
* Fujitsu Microelectronics Ltd * *
* Highway House * phone : (0628) 71116 *
* Norreys Drive * fax : (0628) 773990 *
* Maidenhead. Berks SL6 4BW * email : a.beckett@fmlrnd.co.uk *
***********************************************************************



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:02 CDT