From ca72a8c5d014ff45d5b7164414257e94af6437d5 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Thu, 4 Jul 2019 14:39:04 -0700 Subject: [PATCH] more flexible script finally(full of bashisms tho) --- bright | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bright b/bright index 72ae7a2..6f82d41 100755 --- a/bright +++ b/bright @@ -1,6 +1,11 @@ #!/bin/bash -# Script to siimply change the brightness +# Changes brightness through dmenu (because il ike my eyes) level=$(echo "$(seq 1 100)" | dmenu -i -p 'Brightnesss from 1-100') -percentage=$(echo "$level/100" | bc -l | head -c 4) +[ -z "$level" ] && exit 0 +percentage=$(echo "scale=2;" "$level/100" | bc -l) [ -z "$percentage" ] && exit 0 -xrandr --output eDP-1 --brightness $percentage + +screens="$(xrandr | grep ' connected' | awk '{print $1}')" +for scr in $screens;do + xrandr --output "$scr" --brightness $percentage +done