Comment 76 for bug 935778

luca (llucax) wrote :

Hi, I improved the /etc/udev/rules.d/ script as presented in, this script avoids the no-backlight at all issue and sets the brightness using a quadratic function (it works much better in my Z830 where the lower brightness jumps are very big).

acpi_max=$(cat /sys/class/backlight/toshiba/max_brightness)
acpi_curr=$(cat /sys/class/backlight/toshiba/brightness)
intel_max=$(cat /sys/class/backlight/intel_backlight/max_brightness)
intel_min=100 # What we want the brightness 0 to be
# Linear
# Cuadratic
intel_curr=$(echo "scale=10; ($intel_max-$intel_min)/($acpi_max^2)*$acpi_curr^2+$intel_min" | bc | cut -d. -f1)
echo $intel_curr > /sys/class/backlight/intel_backlight/brightness