sb-memory: replace output with bars
This commit is contained in:
parent
04d95a9908
commit
f5a9256e32
|
@ -1,5 +1,14 @@
|
|||
#!/bin/sh
|
||||
. "colors"
|
||||
|
||||
printf "%b" " "
|
||||
free -m | awk 'NR==2 { printf ("%2.2fG/%2.2fG\n", ($3 / 1024), ($2 / 1024)) }'
|
||||
case "$(free -m | awk 'NR==2 { printf "%d", ($3 / $2) * 10 }')" in
|
||||
0 | 1) color="$fggreen" bar="▁" ;;
|
||||
2) color="$fggreen" bar="▂" ;;
|
||||
3 | 4) color="$fggreen" bar="▃" ;;
|
||||
5) color="$fgorange" bar="▄" ;;
|
||||
6 | 7) color="$fgorange" bar="▅" ;;
|
||||
8) color="$fgred" bar="▆" ;;
|
||||
*) color="$fgred" bar="▇" ;;
|
||||
esac
|
||||
|
||||
printf " <span %s %s>%s</span>" "${bggray}" "${color}" "$bar"
|
||||
|
|
Loading…
Reference in New Issue