1
0
Fork 0

sb-disk cleanup

This commit is contained in:
Luca Bilke 2024-09-23 14:58:24 +02:00
parent 51e6cd49af
commit 04d95a9908
1 changed files with 9 additions and 10 deletions

View File

@ -19,16 +19,15 @@ for mnt in $(findmnt -Py -t "$types"); do
$first || printf " "
percent=$(df "$TARGET" | awk 'NR != 1 { gsub(/%/, "", $5); print $5 }')
case "$(printf %d $((percent / 10)))" in
0 | 1) color=$fgwhite bar=▁ ;;
2) color=$fgwhite bar=▂ ;;
3 | 4) color=$fgwhite bar=▃ ;;
5) color=$fgwhite bar=▄ ;;
6 | 7) color=$fgwhite bar=▅ ;;
8) color=$fgorange bar=▆ ;;
9 | 10) color=$fgred bar=▇ ;;
*) color=$fgblack bar= ;;
percent=$(df "$TARGET" | awk 'NR != 1 { gsub(/%/, "", $5); printf "%d", $5 / 10 }')
case "$percent" in
0 | 1) color="$fggreen" bar="▁" ;;
2) color="$fggreen" bar="▂" ;;
3 | 4) color="$fggreen" bar="▃" ;;
5) color="$fggreen" bar="▄" ;;
6 | 7) color="$fggreen" bar="▅" ;;
8) color="$fgorange" bar="▆" ;;
*) color="$fgred" bar="▇" ;;
esac
printf "%b <span %b %b>%b</span>" "${icon}" "${color}" "${bggray}" "${bar}"