blob: c5629cd1a2a3b287cb126bd10b2ff391a33e2b8c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/sh
# Status bar module for disk space
# $1 should be drive mountpoint, otherwise assumed /.
location=${1:-/}
[ -d "$location" ] || exit
case "$location" in
"/home"* ) icon="H" ;;
"/mnt"* ) icon="M" ;;
*) icon="O";;
esac
printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')"
|