Limiting Kids' Computer Time? 100
Bibu asks: "As a parent of three, I have to spend a lot of effort to keep my kids away from the computer. Until now, we had a Linux box in which a little cron script would just shutdown the machine after half an hour, when the kids were using it. Does someone on Slashdot have a fancier solution? One that keeps track, controls the total time per user per day, and would warn the user of the upcoming deadline (e.g. in five minutes their time is up)? Since we just moved to Mac OS X, solutions for that platform are preferred."
That's not the question (Score:4, Informative)
Now, back on topic: cron's a good start, but AppleScript can help you. Schedule the command osascript -e "display dialog \"You have five minutes left on the computer\"" & sleep 300 && osascript -e "tell app \"Finder\" to log out" - it's probably a little cleaner of an interface that way. Ampersands sic: the single ampersand causes the first command to run in the background, so the timer starts ticking as soon as the dialog appears. The double ampersand waits for the five minutes to finish. (This isn't the idea behind the different syntaxes, but it's close enough for our purposes.)
Is it obligatory? (Score:2, Informative)
"Until now, we had a Linux box in which a little cron script would just shutdown the machine after half an hour, when the kids were using it. Does someone on Slashdot have a fancier solution?"
login.conf (Score:5, Informative)
accounted true
daytime time
to
where accounted turns accounting on and where time is the time in seconds but can prefixed in the unix way i.e. 2h is 2 hours.
daytime limits the total wall clock time allowed per day. You can also set per session limits (sessiontime) and total times per week (weektime) as well, if you would like as well.
use the command warntime to set the end of time warning, but it may send this to the login tty rather than to X (or whatever the mac graphics are).
For the exact format take a look at:
http://www.onlamp.com/pub/a/bsd/2001/01/17/FreeBS
Mac Minder and DG Complete (Score:3, Informative)
Michael. [michael-forman.com]