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!
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
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:
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:
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
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"