I guess you should be able to do that, since there is a applet to control screen brightness. EDIT: I'm no developer by any means though, so don't ask me