8

My Lenovo T440s starts up with maximum brightness. Following this thread I have tried to alter rc.local, but this does not work.

When I execute the command cat /sys/class/backlight/acpi_video0/brightness I get the output 851. Then I lower my brightness manually via the hotkeys and execute the command again - it still shows 851.

This leads me to believe that I cannot control my brightness in this way by simply adding a command to rc.local.

Is there anything else I can try?


Here is the grub content

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT="0"
GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="2"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE="640x480"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

GRUB_DISABLE_OS_PROBER="true"

Here is the rc.local content

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

#echo 2 > /sys/class/backlight/acpi_video0/brightness
#echo 2 > /sys/class/backlight/intel_backlight/brightness

#xrandr --output eDP1 --brightness 0.3
rfkill block bluetooth
#echo 3 > /sys/class/backlight/thinkpad_screen/brightness
exit 0
1
  • try my answer man , it will work
    – nux
    Feb 1, 2014 at 20:08

6 Answers 6

6

Have you tried using some software to avoid manually dealing with the sys filesystem? I suggest using xbacklight.

xbacklight -set 10

This command will set the brightness of the screen to 10%. You can add that to your rc.local.

Edit: If the above procedure is not working there might be some problems between the kernel and the bios acpi. Edit the file: /boot/grub/menu.lst

Add the following parameters to the default configuration: thinkpad-acpi.brightness_enable=1 acpi_backlight=vendor

The default line shoud look something like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash thinkpad-acpi.brightness_enable=1 acpi_backlight=vendor"

Save the modified file and run:

sudo update-grub

Reboot and check if xbacklight is working

7
  • I tried that command in the terminal and it did not change the backlight at all (tried many values, 10, 40, ...). I also added it in rc.local, but didn't change anything upon reboot.
    – BillyJean
    Jan 23, 2014 at 7:13
  • It seems like something is "blocking" me from changing it via a command
    – BillyJean
    Jan 23, 2014 at 7:18
  • Edited the answer, check if this solves your problem... Jan 23, 2014 at 9:49
  • I don't have a file named menu.lst in /boot/grub
    – BillyJean
    Jan 23, 2014 at 16:44
  • 1
    Sorry for the late response... Anyway, for some reasons I thought you were using the LST version of ubuntu. In the latest version that file has moved (due to the passage to GRUB2) to "/etc/default/grub"... You can safely remove the file you already created. The system will ignore it. Jan 25, 2014 at 9:09
1

This is obviously a Kernel Compatibility issue with some Hardwares, and I just want you to try this workaround:

  1. Backup and open grub file. Open terminal ( Ctrl+Alt+T ) and type:

    sudo cp /etc/default/grub /etc/default/grub.bak
    sudo gedit /etc/default/grub
    
  2. You will find this line in the new opened window: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

    Change it to:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
    
  3. Save and close the window and update your grub:

    sudo update-grub
    
  4. Restart your system:

    sudo reboot
    

if above procedure doesn't work then repeat the same step but this time try to change the line in step 2 with this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force"

Reply if something goes wrong. If it doesn't work, please edit your question and paste you grub file contents: cat /etc/default/grub

5
  • Thanks, it didn't work. Pasted my grub-file contents in OP
    – BillyJean
    Jan 25, 2014 at 9:14
  • @BillyJean: I don't see any difference. Your grub file is what it was expected. Have you tried the second option i,e replacing the line with GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force"? Just for confirmation.. I also want you to execute this command after sudo update-grub command: sudo update-initramfs -u and restart your system. Reply what happens.. Jan 25, 2014 at 13:07
  • Yes, I also tried GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force". Also tried running sudo update-initramfs -u after sudo update-grub, but still nothing after reboot
    – BillyJean
    Jan 25, 2014 at 16:37
  • 1
    @BillyJean: I wish someone will figure out and solve your issue. In your spare time you can go through this link. Hope it would work for you.. Jan 25, 2014 at 17:57
  • Kernel Compatibility issue with some Hardwares is important statement, I select lower kernel version on grub menu and it doesn't have brightness issue.
    – 林果皞
    Feb 12, 2022 at 17:16
1

If you are using Gnome 3 or Unity -

Checkout the master branch from https://github.com/ishanthilina/setBrightness.

If you are using Gnome 2 -

Checkout the Gnome2 branch from https://github.com/ishanthilina/setBrightness.

This is a python script solve your problem.

The command to be given in the startup applications is “python ////setBrightness.py < Brightness level>”.

An example would be python /home/ishan/.setBrightness/setBrightness.py 20 . If you do not specify a brightness level, the script will change the brightness level according to the time of the day. If it’s between 7am and 8pm, the script will make the brightness be set to 75.

If it’s between 8pm and 7am, the script will make the brightness be set to 20. You can edit these brightness levels by changing the variables day_level and night_level respectively.

source

1

From the wording of your question I think you only tried controlling the brightness with /sys/class/backlight/acpi_video0/brightness, but there are possibly other brightness controlling pseudo-files in your /sys/ file system. See my answer here, which I sum up below:

  1. Run

    tail /sys/class/backlight/*/brightness
    

    will output something like

    ==> /sys/class/backlight/acpi_video0/brightness <==
    7
    
    ==> /sys/class/backlight/radeon_bl/brightness <==
    255
    
    ==> /sys/class/backlight/toshiba/brightness <==
    -5
    
  2. Now lower or increase the brightness level as you normally do, and after that run again: tail /sys/class/backlight/*/brightness , will output the new values, e.g.:

    ==> /sys/class/backlight/acpi_video0/brightness <==
    6
    
    ==> /sys/class/backlight/radeon_bl/brightness <==
    255
    
    ==> /sys/class/backlight/toshiba/brightness <==
    -5
    
  3. The file for which the outputed number in the above output is changed after adjusting the brightness is the file which controls your brightness, so you will have to use that one.

6
  • This is useful! The string that changes is /sys/class/backlight/thinkpad_screen/brightness. At minimum it displays 3, at maximum it displays 5. When I change the brightness manually via hotkeys, the brightness-bar-length also only changes once even though the physical brightness changes 10 levels?
    – BillyJean
    Jan 25, 2014 at 13:06
  • 1
    @BillyJean Then you just have to use that one in rc.local. You can follow my linked answer for instructions with the whole process. I don't know how the graphical feedback is shown for the brightness change, that can be buggy. You can echo allowed values to this pseudo-file and see how the brightness changes (Just don't echo a value above the maximum or below 0, but even if you do so I think it won't cause any problem.), this is also written in my other answer.
    – falconer
    Jan 25, 2014 at 13:13
  • Just tried adding echo 3 > /sys/class/backlight/thinkpad_screen/brightness to my rc.local-file, but nothing changed upon reboot... when I run sudo bash -c "echo 3 > /sys/class/backlight/thinkpad_screen/brightness" nothing happens at all either. Maybe there is a connection between these two observations?
    – BillyJean
    Jan 25, 2014 at 16:33
  • @BillyJean That is strange that it won't change the brightness. Say that you turn up brightness to max so cat /sys/class/backlight/thinkpad_screen/brightness report 5. Now you do sudo bash -c "echo 3 > /sys/class/backlight/thinkpad_screen/brightness" . Nothing changes? Run again cat /sys/class/backlight/thinkpad_screen/brightness , does it still report 5 or is it changed to 3?
    – falconer
    Jan 25, 2014 at 16:54
  • 1
    @BillyJean Strange.
    – falconer
    Jan 25, 2014 at 19:09
0

Then I lower my brightness manually via the hotkeys and execute the command again ...

As you can lower the brightness using Hokeys the following dbus or xdotool method should work

xbacklight

$ xbacklight +30% # increases brightness by 30 percent
$ xbacklight -30% # decreases brightness by 30 percent

dbus way

$ dbus-send --session --print-reply \
      --dest="org.gnome.SettingsDaemon" \
      /org/gnome/SettingsDaemon/Power \
      org.gnome.SettingsDaemon.Power.Screen.SetPercentage \
      uint32:<percentage>
Example

Set brightness to 30%:

$ dbus-send --session --print-reply \
      --dest="org.gnome.SettingsDaemon" \
      /org/gnome/SettingsDaemon/Power \
      org.gnome.SettingsDaemon.Power.Screen.SetPercentage \
      uint32:30 

Or
To decrease brightness by a step (~7)

$ dbus-send --session --print-reply \
      --dest="org.gnome.SettingsDaemon" \
      /org/gnome/SettingsDaemon/Power \
      org.gnome.SettingsDaemon.Power.Screen.StepDown

To increase brightness by a step (~7)

$ dbus-send --session --print-reply \
      --dest="org.gnome.SettingsDaemon" \
      /org/gnome/SettingsDaemon/Power \
      org.gnome.SettingsDaemon.Power.Screen.StepUp

If it says as follows your OS may be too old. Then use xdotool:

Error org.freedesktop.DBus.Error.UnknownMethod: 
Method "SetPercentage" with signature "u" on interface 
"org.gnome.SettingsDaemon.Power.Screen" doesn't exist

xdotool

  • Increase brightness:

    $ xdotool key XF86MonBrightnessUp
    
  • Decrease brightness:

    $ xdotool key XF86MonBrightnessDown
    

After successfully tested ant of above method you can add it to /etc/rc.local

Software way
If you cant's use any of the following method to adjust your hardware back-lid brightness then adjust the software brightness of your display.
xrandr --output OUTPUT --brightness VALUE
For exapmle
xrandr --output LVDS1 --brightness 0.9
You can find connected displays using xrandr | grep connected

7
  • Tried the first command, it gives me method return sender=:1.7 -> dest=:1.137 reply_serial=2 uint32 100, nothing else happens
    – BillyJean
    Jan 25, 2014 at 16:34
  • Expected Output method return sender=:1.6 -> dest=:1.111 reply_serial=2 uint32 30
    – totti
    Jan 26, 2014 at 5:33
  • But the brightness is not changed, it only gives me that output
    – BillyJean
    Jan 26, 2014 at 10:03
  • Your final suggestion with xrandrworks. Using 0.6 for example lowers it, and 1.0 maximizes it. But if I use 0.5 and then want to turn it up to max with hotkeys, then it stops at ca. 0.8. So there is still a fundamental problem, but at least something works now
    – BillyJean
    Feb 1, 2014 at 11:41
  • Where should I add the command for it to be executed upon startup? I tried with /etc/rc.local, but it doesn't change brightness on startup
    – BillyJean
    Feb 1, 2014 at 11:45
0

I had a similar problem on my t430s after I upgraded from OpenSuse 12.3 (3.7 kernel) to 13.1 (3.11 kernel). The display was always at max brightness on boot, but my bigger concern was that the brightness function keys were (usually) not working. Xbacklight would (usually) work, but not always. If I'd change the brightness to 80 using xbacklight, that would work. If I'd change it to 70, nothing would happen until I pressed the reduce-brightness function key. Then it would drop to (about?) 70%. It was really weird.

For unrelated reasons, I switched to Mint 16 Cinnamon before I found a solution. The function keys are working fine now, so I haven't looked into it further. (I'm NOT suggesting switching distros as a solution, BTW!) Before I switched, here's what I learned:

I read (somewhere??) that the 3.8 + kernels address a hardware trend related to Windows 8: Win8 requires hardware to report back 101 brightness levels; the t430 only supports 16. I'm guessing that the kernel is "asking" hardware that "thinks" in 1/16ths for a brightness change of 1/101th! (Please don't quote me on this.)

Instead of using acpi_backlight=vendor in /etc/default/grub, you could try acpi_backlight="!Windows 2012" -- i.e., tell it "I'm not using Windows 8!" Some of the OpenSuse folks were having success with this, though none of them were using Thinkpads. Give it a shot.

2
  • @BillyJean -- Aah -- you'll probably have to escape the quotes around "!Windows2012" or use single quotes instead. (I'm n/s!) GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=\"!Windows2012\"" Feb 2, 2014 at 2:10
  • Thanks for the suggestion. I tried out both options (with/without quotes), but didn't work unfortunately. Should've gone with the Mac... :)
    – BillyJean
    Feb 2, 2014 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .