add atstart, atexit function (e.g. dis/enable screen dimming)