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

19 lines
350 B
Plaintext
Raw Normal View History

2022-07-04 21:36:33 +02:00
#!/bin/sh
# reset="\033[0m"
# big="\033[12m"
2023-11-21 14:34:46 +01:00
IFS='
'
2023-11-22 20:42:33 +01:00
types=${1:-ext2,ext3,ext4,xfs,btrfs,vfat}
2023-11-21 14:34:46 +01:00
first=true
for mnt in $(findmnt -Py -t "$types"); do
2024-01-02 19:09:46 +01:00
[ "$first" = "false" ] && printf " | "
eval $mnt
[ -d "$TARGET" ] || break
name=$TARGET
printf "%b" "${name}: $(df -H "$TARGET" | awk ' /[0-9]/ {print $3 "/" $2}')"
first=false
2023-11-21 14:34:46 +01:00
done
printf "\n"