1
0
Fork 0
dotfiles/.local/bin/statusbar/sb-disk

19 lines
368 B
Bash
Executable File

#!/bin/sh
# reset="\033[0m"
# big="\033[12m"
IFS='
'
types=${1:-ext2,ext3,ext4,xfs,btrfs,vfat}
first=true
for mnt in $(findmnt -Py -t "$types"); do
[ "$first" = "false" ] && printf " | "
eval $mnt
[ -d "$TARGET" ] || break
name=$TARGET
printf "%b" "${name}: $(df -H "$TARGET" | awk ' /[0-9]/ {print $3 "/" $2}')"
first=false
done
printf "\n"