Skip to content

Instantly share code, notes, and snippets.

@ManuelSchmitzberger
Last active November 24, 2019 10:02
Show Gist options
  • Save ManuelSchmitzberger/85bc13612ca965cc0e303528d6d7265f to your computer and use it in GitHub Desktop.
Save ManuelSchmitzberger/85bc13612ca965cc0e303528d6d7265f to your computer and use it in GitHub Desktop.
Intel Screen Backlight control
#!/bin/bash
# intel-backlight-control.sh [brightness-in/-decrease value]
# intel-backlight-control.sh +400
# intel-backlight-control.sh -400
folder="/sys/class/backlight/intel_backlight"
# the values can be read "/sys/class/backlight/intel_backlight/max_brightness"
max=24242
min=1000
currentValue=$(cat $folder/brightness)
addValue=$1
setValue=$(($currentValue + $addValue))
echo $setValue
if [ $setValue -lt 100 ]; then
setValue=100;
elif [ $setValue -gt $max ]; then
setValue=$max;
fi
echo $folder/brightness
echo -n $setValue > $folder/brightness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment