Staton.us

OS-X Login Time


This Python script looks in system.log and calculates the time you have been using OS-X today.
This can be implemented as a Cocoa application to provide a way for kids to tell how much time they have
left before the Parental Control time limit expires.

You will have to make system.log readable by the administered user.
You will also have to make sure the first line of the python script points to your python.
Mine is at /opt/local/bin/python

logintime.py

Note that the system.log Wake and Sleep events don't indicate who logged in, so this implementation only works on systems
with a single administered user that isn't shared with other users.
I'll fix this in the next version.

I used this as an exercise in calling Python from Objective-C.
I also used it as an exercise in creating a menu item. Here is a useful tutorial.
Xcode project: LoginTime
| © 2008 Ken Staton