2023-06-27 10:13:14 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-08-20 00:01:31 -04:00
|
|
|
get_icon () {
|
|
|
|
val=$(brightnessctl get)
|
2023-06-27 10:13:14 -04:00
|
|
|
|
2023-08-20 00:01:31 -04:00
|
|
|
if [ "$val" -le 3 ]; then
|
|
|
|
eww update br_icon=" "
|
2023-06-27 10:13:14 -04:00
|
|
|
|
2023-08-20 00:01:31 -04:00
|
|
|
elif [ "$val" -le 38 ]; then
|
|
|
|
eww update br_icon=" "
|
2023-07-30 22:15:44 -04:00
|
|
|
|
2023-08-20 00:01:31 -04:00
|
|
|
elif [ "$val" -le 77 ]; then
|
|
|
|
eww update br_icon=" "
|
2023-06-27 10:13:14 -04:00
|
|
|
|
2023-08-20 00:01:31 -04:00
|
|
|
elif [ "$val" -le 115 ]; then
|
|
|
|
eww update br_icon=" "
|
2023-06-27 10:13:14 -04:00
|
|
|
|
2023-08-20 00:01:31 -04:00
|
|
|
elif [ "$val" -le 153 ]; then
|
|
|
|
eww update br_icon=" "
|
|
|
|
|
|
|
|
elif [ "$val" -le 191 ]; then
|
|
|
|
eww update br_icon=" "
|
|
|
|
|
|
|
|
elif [ "$val" -le 230 ]; then
|
|
|
|
eww update br_icon=" "
|
|
|
|
|
|
|
|
else
|
|
|
|
eww update br_icon=" "
|
|
|
|
fi
|
2023-06-27 10:13:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if [[ $1 == "br" ]]; then
|
2023-08-20 00:01:31 -04:00
|
|
|
brightnessctl get
|
2023-06-27 10:13:14 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $1 == "icon" ]]; then
|
2023-07-30 22:15:44 -04:00
|
|
|
while true; do
|
2023-08-20 00:01:31 -04:00
|
|
|
sleep 1
|
2023-07-30 22:15:44 -04:00
|
|
|
get_icon
|
|
|
|
done
|
2023-06-27 10:13:14 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $1 == "set" ]]; then
|
2023-08-20 00:01:31 -04:00
|
|
|
brightnessctl set "$2"
|
|
|
|
get_icon
|
2023-06-27 10:13:14 -04:00
|
|
|
fi
|