Fixed issue with xdg config file in last commit Added progress bar to brightness indicator
24 lines
623 B
Bash
24 lines
623 B
Bash
#!/bin/bash
|
|
bright=`cat /sys/class/backlight/amdgpu_bl0/brightness`
|
|
state=-1
|
|
thresh=(0 1 3 5 9 15 27 48 84 147 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 10 ]]
|
|
then
|
|
echo ${thresh[$new]} | tee /sys/class/backlight/amdgpu_bl0/brightness
|
|
if [[ $? -eq 0 ]] && [[ -f $(which dunstify) ]]
|
|
then
|
|
dunstify -a "changebrightness.sh" -u low -i weather-clear -h string:x-dunst-stack-tag:changebrightness -h string:hlcolor:#ffffff -h int:value:$(($new*10)) "Brightness: $new"
|
|
fi
|
|
fi
|
|
|