dotfiles/de/home/.local/bin/diskspace-check
2025-01-22 09:59:02 -08:00

10 lines
391 B
Bash
Executable file

#!/bin/bash
root_use_pct=`df -h | grep '\s/$' | awk '{print $5}' | tr -d '%'`
home_use_pct=`df -h | grep '\s/home$' | awk '{print $5}' | tr -d '%'`
if [[ "${root_use_pct}" -gt 80 ]];then
notify-send "/ is nearly full!" "${root_use_pct}% disk space usage on /"
fi
if [[ "${home_use_pct}" -gt 80 ]];then
notify-send "/home is nearly full!" "${home_use_pct}% disk space usage on /home"
fi