OS X battery monitor script