0

I have just installed Ubuntu12.04 desktop on my computer. Now it has the following problem: every time when i start my computer, when the boot menu passed by, the screen will turn to be so dark that I can't see any thing if I don't adjust the brightness. I am tired of adjusting brightness at every start up. Is that hardware problems? Is there any manner to avoid that? Thanks!

0

You can put a line in your /etc/rc.local file before the exit 0 line to change the brightness automatically on boot. For this you will have to find out which file is corresponding to your backlight settings in the /sys filesystem. So

tail /sys/class/backlight/*/brightness

will print out the current brightness settings for all devices in that directory. E.g. for me:

==> /sys/class/backlight/acpi_video0/brightness <==
6

==> /sys/class/backlight/radeon_bl/brightness <== 
200

==> /sys/class/backlight/toshiba/brightness <==
-5

Now lower or increase the brightness level as you normally do, and after that run again:

tail /sys/class/backlight/*/brightness

E.g for me the output now is:

==> /sys/class/backlight/acpi_video0/brightness <==
5

==> /sys/class/backlight/radeon_bl/brightness <==
200

==> /sys/class/backlight/toshiba/brightness <==
-5

The file for which the outputed number is changed after adjusting the brightness is the file which controls your brightness, so you will have to use that one. (For me it is /sys/class/backlight/acpi_video0/brightness as you can see.) To find out the maximum allowed brightness level for that device run:

tail /sys/class/backlight/THE_NEEDED_DEVICE/max_brightness

where THE_NEEDED_DEVICE is the one we found earlier, e.g. I would run tail /sys/class/backlight/acpi_video0/max_brightness. So edit the /etc/rc.local file and put a line before the exit 0 line with some similar content to this:

echo N > /sys/class/backlight/THE_NEEDED_DEVICE/brightness

where N is a number between 0 and the maximum allowed brightness level, and THE_NEEDED_DEVICE is the device which we found earlier. (So I would need to use e.g. echo 5 > /sys/class/backlight/acpi_video0/brightness)

If you want to test the brightness setting before you put it into rc.local you can run

sudo bash -c "echo N > /sys/class/backlight/THE_NEEDED_DEVICE/brightness"

from the terminal, e.g for me: sudo bash -c "echo 5 > /sys/class/backlight/acpi_video0/brightness"

  • Thanks, I have restarted my computer just now,It really works.Thanks very much. You are really a genius! – Agla Jan 4 '14 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.