Objective-C code for Mac battery status.