Added brightness script

This commit is contained in:
Damien Broqua 2020-06-06 12:39:11 +02:00
parent f245989088
commit 3b11e44798
3 changed files with 31 additions and 0 deletions

22
Bin/brightness.sh Executable file
View file

@ -0,0 +1,22 @@
#! /bin/bash
CURRENT=`xrandr --verbose | grep -m 1 -i brightness | cut -f2 -d ' '`
GAP=0.1
NEWVALUE=${CURRENT}
case $1 in
up)
NEWVALUE=`echo "${CURRENT}+${GAP}"|bc -l`
;;
down)
NEWVALUE=`echo "${CURRENT}-${GAP}"|bc -l`
;;
reset)
NEWVALUE=1
;;
read)
echo "${CURRENT}*100/1"|bc
;;
esac
xrandr --output eDP-1 --brightness ${NEWVALUE}