#!/bin/bash # Tested Under FreeBSD and OS X FS="/usr" THRESHOLD=90 OUTPUT=($(LC_ALL=C df -P ${FS})) CURRENT=$(echo ${OUTPUT[11]} | sed 's/%//') [ $CURRENT -gt $THRESHOLD ] && /usr/bin/zenity --warning --text="The disk $FS ($CURRENT% used) is almost full. Delete some files or add a new disk." --title="df Warning"