more flexible script finally(full of bashisms tho)

This commit is contained in:
shockrahwow 2019-07-04 14:39:04 -07:00
parent 752004c08f
commit ca72a8c5d0

11
bright
View File

@ -1,6 +1,11 @@
#!/bin/bash #!/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') 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 [ -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