I was happy to find
this tip, which explains how to measure idle time on input devices, but I wanted something that would actually keep track of when the system was idle and when it wasn't -- that way, I could tell how much my wife was actually using her Mac. This tip creates a log with entries for when the machine changes state from idle to non-idle, or vice-versa; the parameters and defaults are straightforward. To run it in the background and immune to
SIGHUP, I use the following:
nohup ./idlemonitor.sh -o /tmp/mac_usage.log &
I'll probably write somehting that renders an HTML page with a pretty graph of when the machine was in use. This will probably require input in the form generated with
-d '%s'. For those adverse to copy and paste, you can download a copy of the script with this command:
curl -O 'http://marty.feebleandfrail.org/macosxhints/idlemonitor/idlemonitor.sh'
[
robg adds: I haven't tested this one, but I did
mirror the script here on hints, so download it from either location if you're interested in checking it out. Remember to make it executable (
chmod +x script_name).]