#!/usr/bin/sh

partition=$1

if [ ! -n "$partition" ]; then
	partition="/"
fi


line=$(/usr/bin/df -h $partition | sed -n 2p)

used=$(echo $line | awk -F ' ' '{print $3}')
total=$(echo $line | awk -F ' ' '{print $2}')
percent=$(echo $line | awk -F ' ' '{print $5}' | sed 's/[^0-9]//')


if [ "$BLOCK_BUTTON" = "1" ]; then
	echo "$used/$total"
	echo "$used/$total"
else
	echo "$label $percent%"
	echo "$label $percent%"
fi


if [ "$percent" -gt 80 ]; then
	echo "#FF8000"
elif [ "$percent" -gt 90 ]; then
	echo "#FF0000"
fi