Tuesday, 20 June 2006
Here is my cleaned-up brightness tool, which now uses the IOKit APIs instead of the weird O3Engine SPIs that the old version did.
% ./brightness usage: ./brightness [-m|-d display] [-v] <brightness> or: ./brightness -l [-v] % ./brightness -l display 0: main display, ID 0x4270a80 display 0: brightness 0.734375 % ./brightness -v 0.3 display 0: brightness 0.296875
-m changes the brightness of the main display; -d changes brightness of whatever display number/ID you provide. -l -v dumps display attributes—sorry for the ugly XML output, but CoreFoundation claims to be unable to output an OpenStep-format property list even though Cocoa has no problem doing the same.
(February 2014: Please see an updated version of this code on GitHub; it makes the -v output more readable among other changes.)