Adjust brightness - Ubuntu, Debian, Arch, etc
-
Hello colleagues, yesterday I installed Kubuntu 13.04 on my laptop and the brightness wasn't working, just like other distributions with a kernel higher than 3.5.
As always, I searched the internet for some solution, but none of them worked, but they gave me an idea of what the solution would be.
So, here's how I solved it:
**
First**We open a terminal and write the following:
ls /sys/class/backlight/Here several folders will appear (they are actually symbolic links), in my case 2:
acpi_video0 intel_backlightInside each of them there are several files, but the ones we are interested in are brightness and max_brightness.
We will then have:
/sys/class/backlight/acpi_video0/brightness
/sys/class/backlight/acpi_video0/max_brightness
/sys/class/backlight/intel_backlight/max_brightness
/sys/class/backlight/intel_backlight/brightnessbrightness: Indicates the current brightness value
max_brightness: Indicates the maximum value that brightness can haveMy values for acpi_video0 are from 0 to 99
My values for intel_backlight are from 0 to 4882**
Second**Now we check which of the two files modifies the brightness:
For this, in a terminal with root permissions or using sudo:
Attention! We are going to modify the brightness value, so don't set it to 0, because you won't see anything. I recommend setting it to half of the maximum value.
Example:If the maximum is 99, we set 50
If the maximum is 5000, we set 2500echo 2500 > /sys/class/backlight/intel_backlight/brightnessIf modifying that file doesn't change the brightness, we try the other one:
echo 50 > /sys/class/backlight/acpi_video0/brightnessOne of the two or the ones you have should change the brightness of your screen.
**
Third**Once we have identified which file modifies the brightness, we are going to create two scripts, one to increase the brightness and another to decrease it:
Increase brightness:
#! /bin/bash brightness=$(cat /sys/class/backlight/intel_backlight/brightness) brightness=$(expr $brightness + 300) echo $brightness > /sys/class/backlight/intel_backlight/brightnessWe save it as SubirBrillo.sh
Decrease brightness:
#! /bin/bash brightness=$(cat /sys/class/backlight/intel_backlight/brightness) brightness=$(expr $brightness - 300) echo $brightness > /sys/class/backlight/intel_backlight/brightnessWe save it as BajarBrillo.sh
**Remember to change both the value to add or subtract and the file path to your appropriate file.
Once we have the scripts, we give them execution permissions:
chmod +x BajarBrillo.sh SubirBrillo.sh**
Fourth**Now we are going to give permission to the brightness file so that the scripts can modify its value.
To do this, we open the file /etc/rc.local with root permissions or sudo
nano /etc/rc.localOnce open, we add the following line just before the exit0 line:
chmod 777 /sys/class/backlight/intel_backlight/brightnessAnd we save the changes.
**
Fifth**Now we can run the scripts to increase and decrease brightness without any restrictions.
But of course, you're not going to run scripts every time you want to increase or decrease brightness, so I recommend that you set up keyboard shortcuts to quickly change the brightness.
**
YOUR BRIGHTNESS SHOULD NOW CHANGE PERFECTLY**And that's it, I hope someone finds this guide useful.
Regards and thanks.
-
Very interesting for those who have problems with that. I have kernel 3.5.0-17 but I can perfectly use the laptop shortcuts for brightness. The only problem I encountered is that the configuration was not saved when exiting, and by default it starts at 100%. I don't remember what I touched but when I logged in I managed to have a lower brightness (around 75%). -
In some distros I have found that the brightness of the laptop screen changes uncontrollably creating a flash effect. That is, it goes up and down wildly and does not stay fixed. Can this method be a solution?