diff options
Diffstat (limited to 'tools/misc/brightness.sh')
-rwxr-xr-x | tools/misc/brightness.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/misc/brightness.sh b/tools/misc/brightness.sh index 8533a93..4f548f5 100755 --- a/tools/misc/brightness.sh +++ b/tools/misc/brightness.sh | |||
@@ -1,6 +1,10 @@ | |||
1 | #! /usr/bin/env bash | 1 | #! /usr/bin/env bash |
2 | 2 | ||
3 | BRIGHTNESS=$(xrandr --verbose | grep Brightness: | cut -d' ' -f2) | 3 | BACKLIGHT_DIR=/sys/class/backlight/intel_backlight |
4 | 4 | ||
5 | VALUE=$( echo $BRIGHTNESS $1 | bc ) | 5 | CURRENT=$(cat $BACKLIGHT_DIR/brightness) |
6 | xrandr --output eDP-1 --brightness $VALUE | 6 | MAX=$(cat $BACKLIGHT_DIR/max_brightness) |
7 | |||
8 | echo " $CURRENT + ( $MAX * ${1/+} )" | \ | ||
9 | bc | \ | ||
10 | cut -d'.' -f1 >$BACKLIGHT_DIR/brightness | ||