dotfiles/sbin/backlighthack.sh

15 lines
565 B
Bash
Executable File

#!/bin/bash
intelmaxbrightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
acpimaxbrightness=`cat /sys/class/backlight/acpi_video0/max_brightness`
scale=`expr $intelmaxbrightness / $acpimaxbrightness`
acpibrightness=`cat /sys/class/backlight/acpi_video0/brightness`
newintelbrightness=`expr $acpibrightness \* $scale`
curintelbrightness=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ "$newintelbrightness" -ne "$curintelbrightness" ]; then
echo $newintelbrightness > /sys/class/backlight/intel_backlight/brightness
fi
exit 0