2018-05-03 20:23:53 +02:00
|
|
|
#/bin/sh
|
|
|
|
|
2023-12-18 21:58:40 +01:00
|
|
|
source $(dirname $0)/../.env
|
2023-02-18 22:29:26 +01:00
|
|
|
source $(dirname $0)/filesystem.data
|
2023-12-18 21:58:40 +01:00
|
|
|
|
2018-05-03 20:23:53 +02:00
|
|
|
output=""
|
|
|
|
for i in "${!parts[@]}"; do
|
|
|
|
avail=$(df -h ${parts[$i]} | tail -1 | tr -s ' ' | cut -d' ' -f4)
|
|
|
|
used=$(df -h ${parts[$i]} | tail -1 | tr -s ' ' | cut -d' ' -f5)
|
|
|
|
num=$(echo ${used} | cut -d'%' -f1)
|
|
|
|
|
|
|
|
if [ "$num" -gt 80 ] ; then
|
2023-12-18 21:58:40 +01:00
|
|
|
color="$MOCHA_RED"
|
2018-05-03 20:23:53 +02:00
|
|
|
elif [ "$num" -gt 50 ] ; then
|
2023-12-18 21:58:40 +01:00
|
|
|
color="$MOCHA_PEACH"
|
2018-05-03 20:23:53 +02:00
|
|
|
else
|
2023-12-18 21:58:40 +01:00
|
|
|
color="$MOCHA_MAUVE"
|
2018-05-03 20:23:53 +02:00
|
|
|
fi
|
2023-12-19 21:32:31 +01:00
|
|
|
output=$output"%{F${color}}${icons[$i]} $used%{F$MOCHA_TEXT} · $avail"
|
2018-05-03 20:23:53 +02:00
|
|
|
if [ $(($i + 1)) -ne "${#parts[@]}" ] ; then
|
|
|
|
output=$output" "
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
2020-09-22 19:06:32 +02:00
|
|
|
echo "$output"
|