I don't know the code, but the propgram "Backlight" works quiite well for me. also with this program you can make the screensaver semi-transparent, which is neat. I think you can get the program on versiontracker.com, and if not there, then at macupdate.com.