#!/bin/sh
# teste l'espace disponible sur la partition système et notifie si >85%

used=$(df / --output=pcent | grep [0-9] | cut -c 1-3)

# set messages & labels
userlocale=$(echo $LANG | cut -b-2)
case $userlocale in
    fr) title="ATTENTION"
        message="Votre partition système est bientôt pleine ($used%)."
        ;;
    *)  title="WARNING"
        message="Your system partition is almost full ($used%)."
        ;;
esac

if test $used -gt 85; then
    notify-send -i dialog-warning -u critical "$title" "$message"
fi
