Command line control of screen and keyboard backlight.
I made this in 2013 and don't use it much, so this isn't maintained. One of the functions it uses is deprecated, but otherwise I don't expect this to have many issues.
On Mac OS X, run
./blackout: command line control of screen and keyboard backlight. -b (b)lack out the screen. -f (f)ade or gradually increase the brightness. -h display this (h)elp message. -s [BRIGHTNESS] set the (s)creen to BRIGHTNESS. BRIGHTNESS is a real number between 0 and 1. -k [BRIGHTNESS] set the (k)eyboard backlight to BRIGHTNESS. N.B.: argument parsing is picky! Flags must be separate, e.g.: $ ./blackout -b -f