Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!gatech!bloom-beacon!dont-send-mail-to-path-lines From: fgreco@govt.shearson.COM (Frank Greco) Newsgroups: comp.windows.x Subject: Re: How to Time Out Inactive Users Message-ID: <9101291657.AA05847@fis1.shearson.com> Date: 29 Jan 91 16:57:39 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 32 > I am writing an application which must time out my users when they have > not touched the keyboard or mouse for a fixed time period, forcing them > to re-enter their password. > > Can anyone think of a good way to solve this problem? All responses are > greatly appreciated. How about checking the last access time of /dev/kbd or /dev/mouse? I use this little script all the time: -------------------------------------------------------------- #!/bin/sh set `ls -lu /dev/mouse` mouse=$8 set `ls -lu /dev/kbd` kbd=$8 set `date` time=$4 echo "Its [$time] - Mouse last touched at $mouse and Keyboard last pressed at $kbd" -------------------------------------------------------------- (Side note: from some tests that I ran, they unexpectedly yielded the same time using X11R4, ie, accessing one changed both times, but under Sunview I got different times for each) Frank G.