Screen brightness reverts to max after returning from `xset dpms` display suspend

display-settingsdpmspower-management

I'm running the openbox window manager and using this line in my autostart.sh to control display power management:

xset dpms 0 60 0

This works nicely, causing the display to suspend after 60 seconds of inactivity.

However, when the display reawakens in response to a mouse movement, keypress, etc., the screen is at full brightness. This is wasteful of power and sometimes blinding. If I use the laptop's brightness control keys (Fn + <-/->) to adjust the brightness, the first press will restore the brightness to what it was before the display was suspended.

What I'd like is for the screen to be at the pre-suspend brightness as soon as the display is reawakened, i.e. without having to hit one of the brightness control keys.

I'm running ubuntu 10.10 on an Acer Aspire 5742.

Best Answer

If you're setting the brightness beforehand (in autostart.sh for example), you could simply keep checking the brightness and setting it to whatever value you want in a continuous while true; loop.

This works only if you always a constant value (because if you decide you want it brighter for a bit, it will automatically dim).

Another possible (but not probable) option is if xset has some kind of callback or hook that you can grab a hold of. In that case you can make it call another script when it resumes.

Related Question