Unable to change brightness in a Lenovo laptop
Brightness adjustment keys <Fn + ⇑/⇓> have no effect (although they are recognized by the environment), and I can't change the brightness using GUI tools as well. This seems like a problem in Linux itself, not the desktop environment.
I can change the brightness in Windows OS, so it's not some kind of hardware fault.
Details:
Lenovo B570 (Model Name: 20093)
Integrated Intel HD graphics card
Kubuntu 11.04 (Linux 2.6.38-10-generic, KDE 4.7.0), everything up to date
No proprietary graphics drivers (only Wi-Fi one)
What I've tried:
- Edit
/etc/default/grub
↦GRUB_CMDLINE_LINUX_DEFAULT
:acpi_osi=Linux
,acpi_backlight=vendor
,nomodeset
. And yes, I didupdate-grub
- Edit
/etc/X11/xorg.conf
(no such file, even aftersudo dpkg-reconfigure xserver-xorg
) - Edit
/proc/acpi/video/VGA/LCD/brightness
(no such file) -
sudo setpci -s 00:02.0 F4.B=
(no effect)XX -
xbacklight -set
("XXNo outputs have backlight property
")
How can I fix this issue?
If the GUI tools fail, try to use the terminal for it.
Open a terminal
-
Run:
ls /sys/class/backlight/*/brightness
. Example output would be:/sys/class/backlight/acpi_video0/brightness
-
If nothing is found, the kernel does not support brightness control (missing drivers?). Otherwise, you can use the below commands (replace
acpi_video0
accordingly):-
Get the current brightness level:
cat /sys/class/backlight/acpi_video0/brightness
-
Get the maximum brightness level:
cat /sys/class/backlight/acpi_video0/max_brightness
These commands return brightness levels which ranges from zero to max_brightness (see above).
-
-
To change the brightness level, you need to write a number to the
brightness
file. This cannot be done by an editor likegedit
. Say you want to change your brightness to 5, you have to run:echo 5 | sudo tee /sys/class/backlight/acpi_video0/brightness
Alternatively, if you just want to set the brightness level to the highest available:
sudo tee /sys/class/backlight/acpi_video0/brightness < /sys/class/backlight/acpi_video0/max_brightness
Try this. It worked for my Ubuntu 14, Lenovo B570, Intel Graphics.
Open a terminal and create the following configuration file, if it does not exist:
sudo touch /usr/share/X11/xorg.conf.d/20-intel.conf
Now we need to edit this file. You can use any editor be it a terminal one or graphical.
sudo gedit /usr/share/X11/xorg.conf.d/20-intel.conf
Add the following lines to this file:
Section "Device"
Identifier "card0"
Driver "intel"
Option "Backlight" "intel_backlight"
BusID "PCI:0:2:0"
EndSection
Save it. Log out and log in back.
-
Install
linux-kamal-mjgbacklight
- a patch for Linux kernel.- Check whether it will work for you:
lsmod | grep ^i915
Something likei915 331519 3
should appear. If there's no output, this will not work. sudo add-apt-repository ppa:kamalmostafa/linux-kamal-mjgbacklight
- Install updates (
sudo apt-get update; sudo apt-get upgrade
)
- Check whether it will work for you:
Reboot.
Now you can use the terminal to adjust brightness, as suggested by Lekensteyn.
If it's OK for you to change brightness with terminal+sudo
, this is the end of the answer.
If you are on GNOME desktop, brightness may even function fully already.Download my brightness changer script, allow it to be executed, and put it to /usr/local/bin/:
wget -O brightness http://ideone.com/plain/yPlo5
chmod +x brightness
sudo mv brightness /usr/local/bin
-
We have to allow the brightness file to be edited, so that
sudo
isn't needed everywhere.
Also, we want to make the brightness setting restore itself to the previous setting when the system boots (it is not saved by default, unfortunately).The mentioned
brightness
script can handle it all (withrestore
parameter), just add it to autorun.
To do this we will edit /etc/rc.local (sudo nano /etc/rc.local
or any editor instead of nano).
Add the following line before theexit 0
line:/usr/local/bin/brightness restore
It is best to reboot now.
-
So the
brightness
script works. You may go to terminal any time and type these:-
brightness
- get current brightness setting -
brightness value
- set the brightness to value -
brightness inc step
,brightness dec step
- increase or decrease the brightness by step (if it's not specified, a default value is used from the configuration file, usually 10% of maximal brightness)
-
-
Now you might want to map brightness change to your hotkeys.
- Set XF86BrightnessUp to
brightness inc
- Set XF86BrightnessDown to
brightness dec
- Set XF86BrightnessUp to
If you want to tweak something, make sure to look at /etc/bx_brightness.conf
You can change the step by which brightness is changed withbrightness inc
/dec
Thanks to Toz for his priceless help in this thread.