Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Tracking idletimes



Phil Pennock (phil@xxxxxxxxxxxxxxxxxxxxx) wrote...
> Typing away merrily, Gossamer produced the immortal words:
> > I want to put together a daemon to track idletime, the sort of thing
> > that tells you to get up and stretch every half hour of worktime.
> Make it sleep half an hour at a time then.
> while :
> do
>   sleep $[60*30]
>   do_whatever
> done

Doesn't quite solve the problem, it's too simple :-/.

Let me explain it this way:  Because of various things beyond my
control, my workstyle is to sit down at various times during the
day/night and do about half an hour of work.  After that half hour
it's really important I get up and stretch and walk around.  Imagine a
sort of body-wide tendancy to RSI.

What I want the computer to do is somehow "sense" when I'm using it
and tell me to get up and stretch.  Then to "know" when I have -
because if I haven't then it keeps telling me every minute to get up
until I do.  I mean 'tell' literally by the way - I use a voice synth
:).

>> If I run a shellscript that calls other programs, the idletime for
>> that VT gets reset every time the secondary program is activated. 
>> It also seems to like to report Mutt as un-idle even when it is.
> What are you using to try and get 'idle time'?

At the moment it's a perl script that parses the output of 'finger
@localhost' but that just grabs it from /var/wtmp.  I haven't been
bothered to write a module to access wtmp directly.


bekj

-- 
: --Hacker-Neophile-Eclectic-Geek-Grrl-Gay-Disabled-Boychick--
: gossamer@xxxxxxxxxxxxxx  http://www.tertius.net.au/~gossamer/
: It is the business of the future to be dangerous.  -- Hawkwind



Messages sorted by: Reverse Date, Date, Thread, Author