Ubuntu / Linux news and application reviews.

If your laptop's brightness is not saved and is set to a very low value or to maximum, each time you reboot and / or when you log out, read on for a fix / workaround.

Ubuntu brightness

In both Ubuntu 14.04 and 14.10, my laptop's brightness is not saved between sessions and is reset to a very low value after every reboot or logout. I found a workaround (that works for both this issue as well as another issue which is basically the opposite: the brightness is set to maximum after restarting Ubuntu), but it was a bit confusing so I thought I'd improve the steps and share it with you.

Basically, the fix / workaround is to automatically set a custom brightness value each time you boot into Ubuntu. Let's proceed.

1. The first thing you need to do is to find out which ACPI interface (acpi_video) controls the brightness. This can be done by looking into your Xorg log file to see which acpi_video was loaded. To do this via command line, simply use the following command:
grep acpi_video /var/log/Xorg.0.log
The command above should display an output similar to this:
[     7.385] (--) intel(0): Found backlight control interface acpi_videoX (type 'firmware') for output LVDS1
where "acpi_videoX" is "acpi_video0" or "acpi_video1". This is the acpi_video that controls the brightness, so remember it for the next steps.

If the command above doesn't display any output and you have a folder called "intel_backlight" under "/sys/class/backlight/", then use "intel_backlight" as the ACPI interface for the next steps.

2. Next, set (via keyboard Fn + brightness keys) your laptop's brightness to the level you want Ubuntu to use after when it starts.

3. Now we'll have to get the actual brightness value you set under step 2. To do this, run the following command:
cat /sys/class/backlight/acpi_videoX/brightness
where "acpi_videoX" is the ACPI interface which controls your laptop's brightness, which you find out under step 1.

Remember this value for the next step.

4. The next step is to create a file (as root) called fixbrightness.conf in your /etc/init/ directory - I'll use Gedit below:
gksu gedit /etc/init/fixbrightness.conf

And in this file, paste this:
description "Sets brightness after graphics device is loaded"

start on graphics-device-added
exec /bin/echo BRIGHTNESS_VALUE > /sys/class/backlight/acpi_videoX/brightness
here, you need to:
  • replace BRIGHTNESS_VALUE with the brightness value you got under step 3;
  • replace acpi_videoX with the ACPI Interface that controls your laptop's brightness, which you found out under step 1.

Then save the file.

5. Reboot and the low or maximum brightness issue after reboot / logout should be fixed.

via AskUbuntu but I tried to improve the instructions