[arch-general] Nvidia backlight control - acpi_video0/brightness changes - display doesn't?

David C. Rankin drankinatty at suddenlinkmail.com
Sat Nov 19 08:00:11 UTC 2016


On 11/18/2016 11:17 PM, David C. Rankin wrote:
> On 11/18/2016 11:02 PM, David C. Rankin wrote:
>> I've got to get something figured out. This laptop will absolutely blind you
>> when you open a browser, or anything with a white background. I have the
>> backlight set at 40% in win10 and that works well. Here it looks like it is on
>> MAX continually. I will keep at it. If anyone has any other idea, let me know.
>> Thanks.
> 
> I don't believe this! I have I can effect the brightness with xrandr, but the
> output name is 'LVDS-0' instead of 'LVDS' (as it is on my other laptops). I
> don't know if this could be the whole problem with the normal backlight
> controls not working -- anyone have any idea? I'll just modify the xbacklight
> script to call xrandr instead of xbacklight and pass it fractional values
> between 0.5 and 1.0. Strange indeed.
> 

Here was the ultimate fix for this laptop. Now the brightness adjusts for each
press of the up/down brightness keys. It is a variation on the script for
xbacklight. It simply transforms the acpi_video0 value into a form that is
passed to xrandr. (I would add this to the wiki, but all that I add, is
seemingly later removed -- so if it is something that would be helpful in the
Backlight wiki, I'll let the wiki master add it)

#!/bin/sh

path=/sys/class/backlight/acpi_video0

luminance() {
    read -r level < "$path"/actual_brightness
    factor=$((100 / max))
    brt=$((level * factor))
    case "$brt" in
        [0-9]       )  printf "0.%02d" $brt;;
        [0-9][0-9]  )  printf "0.%02d" $brt;;
        100         )  printf "1.0";;
    esac
}

read -r max < "$path"/max_brightness

inotifywait -me modify --format '' "$path"/actual_brightness | while read; do
    xrandr --output LVDS-0 --brightness $(luminance)
done


-- 
David C. Rankin, J.D.,P.E.


More information about the arch-general mailing list