Power Source Variable? |
RobertSnyder 02-16-2002, 10:51 AM Does anyone know how to call information about the power source (battery or charger) from the system environment? The menu dock Icon served through the systemUIserver checks agains some system variable to tell it whether to show the batter symbol or the charging symbol. Also, there must be some source to get data that can be used to compute time/percent left on a battery or time/percent left until fully charged.
I am looking to call this information from the AppleScript that was posted for an intellegent sleep (http://http://forums.macosxhints.com/showthread.php?s=&threadid=865) if the load is below 0.8. Adding the battery status to this script would allow you to check if the powersource is battery, and the load is lower than 0.8 then sleep, you could check every 15 minutes, and while not the same as the old Classic Engery Saver, a much better solution than doing nothing or always sleeping your system eventhough it is plugged in.
Robert
|
|
|
|
|