23 lines
398 B
Bash
23 lines
398 B
Bash
|
#! /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}
|