Skip to content

Instantly share code, notes, and snippets.

@fd0
Created April 6, 2014 19:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fd0/10010322 to your computer and use it in GitHub Desktop.
Save fd0/10010322 to your computer and use it in GitHub Desktop.
#!/bin/bash
max=$(cat /sys/class/backlight/intel_backlight/max_brightness)
cur=$(cat /sys/class/backlight/intel_backlight/actual_brightness)
step=$(($max/20))
case "$1" in
video/brightnessup)
new=$(($cur+$step))
if [ "$new" -gt "$max" ]; then
new="$max"
fi
echo $new > /sys/class/backlight/intel_backlight/brightness
logger "increasing backlight"
;;
video/brightnessdown)
new=$(($cur-$step))
if [ "$new" -lt "0" ]; then
new="0"
fi
echo $new > /sys/class/backlight/intel_backlight/brightness
logger "decreasing backlight"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment