This my personal work. It's clearly based upon the idea in this thread. My script is synchronized with the brightness slider. This is the final and correct solution what we needed I am still looking for a way to do it without nvidiabl. I believe we dont need nvidiabl at all since I can control brightness from nvidia-settings. Don't forget to give me credits for my solution if you post it elsewhere !
How it works? /sys/class/backlight/nvidia_backlight/brightness contains the brightness value when the brightness keys are pressed. But the brightness doesn't change. I noticed this value has a range of 0-15. But the range of the nvidiabl is 0- 127. with some quick math I came with a formula y=15+8x where x represents the brightness value of the keys, and y is the actual brightness./sys/class/backlight/nvidia_backlight/max_brightness contains the maximum brightness, actually I can use this in my script and use remainders and few other things to make my script universal. It's very easy actually. I did not make it universal since I like to have every bit of performance.
- Install latest nvidiabl debian package from https://github.com/guillaumezin/nvidiabl/downloads
- Now open the terminal and type
EnterCode:$ sudo gedit /etc/acpi/events/lenovo_backlight_up
And now save and close the file.Code:event=video LCD 00000086 00000000 action=/etc/acpi/lenovo_backlight.sh
EnterCode:$ sudo gedit /etc/acpi/events/lenovo_backlight_down
And now save and close the file.Code:event=video LCD 00000087 00000000 action=/etc/acpi/lenovo_backlight.sh
EnterCode:$ sudo gedit /etc/acpi/events/lenovo_backlight.sh
And now save and close the file.Code:#!/bin/bash test -f /sys/class/backlight/nvidia_backlight/brightness || exit 0 NEW_VALUE=`cat /sys/class/backlight/acpi_video0/brightness` let BRIGHTNESS=$NEW_VALUE*8+7 echo -n $BRIGHTNESS > /sys/class/backlight/nvidia_backlight/brightness
- Now let's set the necessary permissions for all the files we need to access
Code:$ sudo chmod +x /etc/acpi/lenovo_backlight.sh sudo chown YOURUSERNAME /sys/class/backlight/nvidia_backlight/brightness
- Now let's load nvidiabl at boot time, in terminal type:
add to the bottom:Code:sudo gedit /etc/modules
close and save.Code:nvidiabl
This is the best method, Now the brightness is synchronized with the brightness slider applet.
Don't forget to buy me a beer if you like it