Unable to change brightness in a Lenovo laptop
Solution 1
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.
Solution 2
If the GUI tools fail, try to use the terminal for it.
-
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
Solution 3
-
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.
Solution 4
This will not get your Fn keys working, but you will be able to assign any other key to adjust brightness.
I tried several of these solutions, but nothing worked for me until I found this little indicator program http://codevanrohde.nl/wordpress/?p=128. With it you can set up hot keys to control brightness, use your mousewheel or select from a drop down list in the indicator. I have replaced 'Fn' with 'Win+Alt' which is very similar for my hands and now I can also use it with an external keyboard!
To add PPA and install:
sudo add-apt-repository ppa:indicator-brightness/ppa
sudo apt-get update && sudo apt-get install indicator-brightness
Hot keys should be assigned to:
/opt/extras.ubuntu.com/indicator-brightness/indicator-brightness-adjust --up
and
/opt/extras.ubuntu.com/indicator-brightness/indicator-brightness-adjust --down
Footnote: Out of the box, the birghtness indicator recognizes 7 levels of brightness in my system. By adding acpi_backlight=vendor
to the line GRUB_CMDLINE_LINUX_DEFAULT
in /etc/default/grub
, that number is bumped up to 16!
Solution 5
I think I found an easy and least effect to the existed things' way for adjusting intel_backlight using udev rules.
I noticed "change" action of "backlight" subsystem when I press Fn+Up/Down on my Lenovo G360 notebook running kernel 3.2. So I wrote a rules of /etc/udev/rules.d/99-writeintelbacklight.rules
as below:
ACTION=="change", SUBSYSTEM=="backlight", RUN+="/usr/sbin/writeintelbacklight.sh"
Make the shell script /usr/sbin/writeintelbacklight.sh
contain:
#!/bin/bash
intelmaxbrightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
acpimaxbrightness=`cat /sys/class/backlight/acpi_video0/max_brightness`
scale=`expr $intelmaxbrightness / $acpimaxbrightness`
acpibrightness=`cat /sys/class/backlight/acpi_video0/brightness`
newintelbrightness=`expr $acpibrightness \* $scale`
curintelbrightness=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ "$newintelbrightness" -ne "$curintelbrightness" ]
then
echo $newintelbrightness > /sys/class/backlight/intel_backlight/brightness
fi
exit 0
Of course, you need do a sudo chmod +x /usr/sbin/writeintelbacklight.sh
.
Related videos on Youtube
Comments
-
Oleh Prypin over 1 year
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)XXxbacklight -set
("XXNo outputs have backlight property
")
How can I fix this issue?
- Edit
-
Oleh Prypin over 12 yearsSure there are some problems with drivers! If this command line stuff worked, GUI would work too. But of course it does not work – _
-
Admin over 12 years@Lekensteyn: [did not worked, 11.04 Ubuntu using] - I have tried a lot but it did not worked realtime. Did you mean when changing this it will show live or after reboot?
-
Lekensteyn over 12 yearsChanges are realtime.
-
Oleh Prypin over 12 yearsThis is no longer needed in Ubuntu 11.10
-
littlebat almost 12 yearsAdded "acpi_backlight=vendor acpi_osi=linux video.brightness_switch_enabled=1" into grub boot kernel parameters, "Fn + Up/Down" to change brigtness works on my G360. It's no need to write a Udev rules like above.
-
littlebat almost 12 yearsIt seems adding only one kernel parameter "acpi_backlight=vendor" also works on my G360 now. But, both methods of adding kernel parameters will stop work occasionly. The detail of my case see: Bug 44809 - [Arrandale backlight] Brightness via RANDR has no effect on Sony VAIO VPCYA1V9E: bugs.freedesktop.org/show_bug.cgi?id=44809
-
Andrew almost 9 yearsThank you - This also worked on a Samsung N220 Netbook w/ Integrated Intel Graphics (GMA 3150) running Xubuntu 15.04 "vivid"
-
towi over 7 yearsNope, that killed my X. had to remove the file in the recovery console again.
-
Douglas Lewit over 7 yearsThis does did not work on Lenovo P500.
-
Admin over 7 yearsEven as super user I could not change the brightness level using tee. Why might that be?
-
Lekensteyn over 7 years@Galen If you have not made a mistake in writing to the file, then it could be a model-specfic issue. Try reporting it as bug or search for your laptop model and "linux backlight".
-
Elliot Gorokhovsky almost 7 yearsThis worked for me on a Thinkpad T460 with Ubuntu 17.04, I just had to log out and then log in.
-
saurabheights over 6 yearsWorks in ubuntu 17 as well. Thanks
-
Adriano Rivolli about 6 yearsIt worked for me, however, something curious happened. When the brightness is set to the max, the screen shows no brightness (completely dark), any suggestion? Thanks
-
Pashka about 6 yearsAdded this as a quicklaunch button to the xfce panel on my T420
sudo sh -c "echo brightness 0-$(cat /sys/class/backlight/intel_backlight/max_brightness) && echo $(read line && echo $line) > /sys/class/backlight/intel_backlight/brightness"
-
Enrico almost 5 yearsTo check the PCI bus ID run
lspci -nn
. That said, this didn't work for me in a Thinkpad E490. -
Enrico almost 5 yearsThis one worked for me using a Thinkpad E490. Thanks!
-
Vix over 3 yearsI'm not sure this answer deserves the points it has gained - it is a copy/paste of an answer posted on an external forum without providing /why/ this when pasted into a configuration file -might work-; Enrico provides how to find maybe the bus ID though mine of is a different format 00:02.0 and I am assuming that conversion would be valid, but how do I know this is card0? It did not work for me and the answer doesn't provide any explanation which might help when debugging.