redid volume & some refactoring

This commit is contained in:
nat 2025-06-17 03:42:31 -04:00
parent 18a1ff2f2e
commit b0c590080c
4 changed files with 120 additions and 63 deletions

16
sway/chbright.sh Executable file
View file

@ -0,0 +1,16 @@
bright=`cat /sys/class/backlight/amdgpu_bl1/brightness`
state=-1
thresh=(1 2 3 4 5 6 8 10 13 16 21 27 34 44 57 73 94 120 155 199 255)
for i in ${!thresh[@]}; do
if [ $bright -ge ${thresh[$i]} ]
then
state=$i
fi
done
new=$(($1 + $state))
if [ $new -ge 0 ] && [ $new -le 20 ]
then
echo ${thresh[$new]} | tee /sys/class/backlight/amdgpu_bl1/brightness
fi