1
0
Fork 0

libsb: cleanup

This commit is contained in:
Luca Bilke 2024-09-26 15:17:25 +02:00
parent 29b0a33569
commit e615bc6cb2
1 changed files with 14 additions and 44 deletions

View File

@ -23,48 +23,18 @@ export bggray="background='#414868$bgalpha'"
export bgwhite="background='#C0CAF5$bgalpha'"
meter_bar() {
# shellcheck disable=SC2194
case $1 in
9[0-9] | 100)
color="$fgred"
bar="▉"
;;
8[0-9])
color="$fgorange"
bar="█"
;;
7[0-9])
color="$fgorange"
bar="▇"
;;
6[0-9])
color="$fgorange"
bar="▆"
;;
5[0-9])
color="$fggreen"
bar="▅"
;;
4[0-9])
color="$fggreen"
bar="▄"
;;
3[0-9])
color="$fggreen"
bar="▂"
;;
2[0-9])
color="$fggreen"
bar="▂"
;;
1[0-9])
color="$fggreen"
bar="▁"
;;
0[0-9] | [0-9])
color="$fggreen"
bar=" "
;;
esac
printf "%s:%s" "${color}" "${bar}"
# shellcheck disable=SC2194
case $1 in
9[0-9] | 100) color="$fgred" bar="▉" ;;
8[0-9]) color="$fgorange" bar="█" ;;
7[0-9]) color="$fgorange" bar="▇" ;;
6[0-9]) color="$fgorange" bar="▆" ;;
5[0-9]) color="$fggreen" bar="▅" ;;
4[0-9]) color="$fggreen" bar="▄" ;;
3[0-9]) color="$fggreen" bar="▂" ;;
2[0-9]) color="$fggreen" bar="▂" ;;
1[0-9]) color="$fggreen" bar="▁" ;;
0[0-9] | [0-9]) color="$fggreen" bar=" " ;;
esac
printf "%s:%s" "${color}" "${bar}"
}