From 6c804e57a4fab3a3d9d894a1db3039569babcc79 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Fri, 5 Jul 2019 12:53:08 -0700 Subject: [PATCH] bright --- bright | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bright b/bright index 2abe77d..11c1ea5 100755 --- a/bright +++ b/bright @@ -2,7 +2,7 @@ # this part is only used for startup scripts mainly if [ ! -z "$1" ] then - screens="$(xrandr | grep ' connected' | awk '{print $1}')" + screens="`xrandr | grep ' connected' | awk '{print $1}'`" for s in $screens; do xrandr --output "$s" --brightness "0.7" echo xrandr --output "$s" --brightness "0.7" @@ -10,13 +10,14 @@ then exit 0 fi -# Changes brightness through dmenu (because il ike my eyes) -level=$(echo "$(seq 1 100)" | dmenu -i -p 'Brightnesss from 1-100') -[ -z "$level" ] && exit 0 -percentage=$(echo "scale=2;" "$level/100" | bc -l) -[ -z "$percentage" ] && exit 0 +# Changes brightness through dmenu (because i like my eyes) +level=`seq 1 100 | dmenu -i -p 'Brightnesss from 1-100'` +if [ -z "$level" ]; then exit; fi -screens="$(xrandr | grep ' connected' | awk '{print $1}')" +percentage=`echo "scale=2;" "$level/100" | bc -l` +if [ -z "$percentage" ]; then exit; fi + +screens="`xrandr | grep ' connected' | awk '{print $1}'`" for scr in $screens;do xrandr --output "$scr" --brightness $percentage done