You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bl 500B

123456789101112131415161718192021222324
  1. #!/usr/bin/env sh
  2. #
  3. # pbrisbin 2014 - adjust backlight brightness. Must be run as root.
  4. #
  5. ###
  6. directory=/sys/class/backlight/intel_backlight
  7. cur=$(cat "$directory"/brightness)
  8. max=$(cat "$directory"/max_brightness)
  9. amt=$((max/10))
  10. val=$cur
  11. case "$1" in
  12. u) val=$((cur+amt)) ;;
  13. d) val=$((cur-amt)) ;;
  14. m) val=$max ;;
  15. *) { printf "usage: bl [u|d|m]\n" >&2; exit 64; } ;;
  16. esac
  17. # Bounds check
  18. [ $val -gt $max ] && val=$max
  19. [ $val -lt 0 ] && val=0
  20. echo $val > "$directory"/brightness