Comment 5 for bug 1831587

Revision history for this message
Adam Dyess (addyess) wrote :

There does appear to be a work around here:

https://wiki.archlinux.org/index.php/HP_Spectre_x360_13-4231ng#Brightness_/_backlight

It requires bc and inotify-tools.

The workaround is for a long running program to listen for changes to /sys/class/backlight/intel_backlight

calculate the right luminance value

write them to xrandr.

Here's a slight improvement to the suggested script:

#!/bin/bash
#-----------------------------------------------------------------
# /usr/local/bin/brightness
# be sure this file is executable
#-----------------------------------------------------------------

backlight_path=/sys/class/backlight/intel_backlight
device=`xrandr | grep -w connected | awk '{ print $1 }'`

luminance() {
    read -r level < "$backlight_path"/actual_brightness
    bc <<< "scale=10;$level/$max"
}

read -r max < "$backlight_path"/max_brightness
xrandr --output "$device" --brightness "$(luminance)"

inotifywait -me modify --format '' "$backlight_path"/actual_brightness | while read; do
    echo "$device" $(luminance)
    xrandr --output "$device" --brightness "$(luminance)"
done