busy-bee.net buzz buzz buzz goes the honeybee home | blog | links | about me

linux to an imac

2002-08-16 12:19 / pmset  »

Well, man -k power is what I should've done first in the last entry. That brings up pmset - a command that 'changes power management settings such as idle sleep timing and wake on LAN' - perfect, and saves its changes in /var/db/SystemConfiguration/com.apple.PowerManagement.xml - also perfect since that's exactly the file that gets overwritten when you move the sliders up and down in energy saver (in 10.1.5).

But I couldn't get it to work. It just printed the usage message every time. In a fit of bravery though - having seen just how short the source code is - I thought I'd see where it was failing. So a checkout of IOKitUser, a separate download of IOPMLibPrivate.h, and I can compile my own version with cc -framework iokit -framework foundation -o pmset pmset.c. The result?: A few printfs shows that it dies basically because I don't have a battery. Even if I force it to ignore that fact, it dies on a bus error. So I guess it was just meant for laptops. Ho-hum.

mod_perl -- Speed, Power, Scalability