Dim the screen at dark

Are there times of the night that you find yourself adjusting your screen brightness lower, either to help your eyes or not bother someone else? It can be annoying have to tweak brightness settings all of the time. We'll show you how to set your brightness automatically during the night. Read on.

To start, you need to have a laptop or a display that supports software brightness configuration. You'll also need to make sure that your GNOME brightness settings are working. (KDE fan? Submit a relevant article.) Also, take note that if your system is not on when brightness settings change, they will not be updated.

Now, pop open a terminal to edit your crontab:

crontab -e

Now you'll want to add some time and brightness settings. Use this as a template:

0 22 * * * gconftool-2 --type int --set /apps/gnome-power-manager/backlight/brightness_ac 10
0 7 * * * gconftool-2 --type int --set /apps/gnome-power-manager/backlight/brightness_ac 100

The first line will set the brightness value to 10% at 22:00; the second sets it to full brightness at 07:00. Note that these are not hardware brightness values, but power manager values that scale from 0 to 100. You can add as many lines as you want. If you're proficient in your crontab syntax, then you can even use settings that only apply on weekends or weekdays.

Avatar for jacob Jacob Peddicord - http://jacob.peddicord.net/

Jacob is a web developer, student, and programmer from Ohio. He is a staff member at the Ubuntu Forums and is most likely a fanboy of the distribution. He loves to write in code and words, play video games, and rant about topics most would have abandoned long ago. Jacob uses GNOME and is never seen running stable software, much to the demise of his laptop.

Home » Articles »

Discussion: Dim the screen at dark

  1. # Posted on 09 August 2009 at 02:21 AM

    Because this was asked on Reddit:

    You can use a system cron to echo the hardware brightness value to /proc/acpi/video/???/LCD/brightness, but that increases the complexity a bit as you need:

    * Valid hardware values
    * Root access (system crontab)
    * The value for the ??? above, which differs per system

    Some systems have different methods of changing the brightness entirely, while g-p-m abstracts them all.

  2. Charlie Dyson (guest)

    # Posted on 10 August 2009 at 09:57 AM

    Nice idea! Next problem - periodically average the image from a webcam to come up with a brightness figure and then dynamically adjust the screen's brightness to suit!

  3. Pallab (guest)

    # Posted on 16 August 2009 at 05:03 AM

    I change the colour temperature instead of the brigthness using Xflux. That works a lot better. Give a try. You would love it. http://www.stereopsis.com/flux/

Home » Articles » Dim the screen at dark

Sign In