aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/misc/brightness.sh10
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
3BRIGHTNESS=$(xrandr --verbose | grep Brightness: | cut -d' ' -f2) 3BACKLIGHT_DIR=/sys/class/backlight/intel_backlight
4 4
5VALUE=$( echo $BRIGHTNESS $1 | bc ) 5CURRENT=$(cat $BACKLIGHT_DIR/brightness)
6xrandr --output eDP-1 --brightness $VALUE 6MAX=$(cat $BACKLIGHT_DIR/max_brightness)
7
8echo " $CURRENT + ( $MAX * ${1/+} )" | \
9bc | \
10cut -d'.' -f1 >$BACKLIGHT_DIR/brightness