Last active
November 24, 2019 10:02
-
-
Save ManuelSchmitzberger/85bc13612ca965cc0e303528d6d7265f to your computer and use it in GitHub Desktop.
Intel Screen Backlight control
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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