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

Re: Tracking idletimes




What I do is have a program running which tells me to get up and
stretch every 60 minutes.  The trick is that it uses an Xdialog box
with an ok button.  The thirty minutes starts after ok is pressed.
When I get in to work or whatever, I press ok, and my 60 minutes
starts over. 

I know you're looking for something more complex, but this is simple,
and works for me.

#!/bin/perl
$filename = '$HOME/eye_reminder';
$sleeptime = 60*60;		# 60 minutes sleeptime
$bitmap = '$HOME/public_html/eye.xbm';

while(1){
    $pid = fork;
    if($pid == 0){		# if child
	exec("/usr/bin/X11/xdialog -geometry +450+400 -p $bitmap -f $filename -fg red -bg lightgrey")	# start the dialog box
	}
    else {			# if parent
	wait;			# wait for the dialog box to finish
	sleep($sleeptime);	
    }
}

Anthony

-- 
                                   
Anthony P. Whitehouse              
These opinions do not necessarily represent those of my employer
                                   
Mailto:Anthony_Whitehouse@xxxxxx   
	--or--			   
Mailto:A.Whitehouse@xxxxxxxxxxxx   


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