Add function to quickly check storage.

This commit is contained in:
2025-11-10 14:02:16 -07:00
parent e7ae358fa9
commit 856290c33f

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
function storage {
location="$1"
quiet="$2"
if [[ -z $location ]]; then
echo "ERROR: Location must be passed. $location"
fi
if [[ -n "$quiet" ]]; then
df -h $location | tail -n 1 | awk {print $5", "$3"/"$2""}
else
df -h $location | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"}
fi
}
function storage-root {
storage / $1
}
function storage-root-dwm {
storage-root q
}
function storage-home {
storage /home $1
}
function storage-home-dwm {
storage-root q
}