Closed chaoos closed 6 years ago
#!/bin/bash ratio=$1 max=$(cat /sys/class/backlight/intel_backlight/max_brightness) brightness=$(printf "%.0f\n" $(echo "scale=2; (${ratio}/100)*${max}" | bc)) while true; do echo ${brightness} >/sys/class/backlight/intel_backlight/brightness inotifywait /sys/class/backlight/intel_backlight/brightness done