1
0
Fork 0

switch to binary units for sb-disk/sb-memory

This commit is contained in:
Luca Bilke 2024-05-25 00:43:03 +02:00
parent 68444d212a
commit 915a979cdb
2 changed files with 6 additions and 6 deletions

View File

@ -6,11 +6,11 @@ IFS='
types=${SB_DISK_FS:-ext2,ext3,ext4,xfs,btrfs}
first=true
for mnt in $(findmnt -Py -t "$types"); do
eval "$mnt"
[ -d "$TARGET" ] || break
eval "$mnt"
[ -d "$TARGET" ] || break
[ "$TARGET" = "/var/lib/docker" ] && break
[ "$first" = "false" ] && printf " | "
printf "%b" "${TARGET}: $(df -H "$TARGET" | awk ' /[0-9]/ {print $3 "/" $2}')"
first=false
[ "$first" = "false" ] && printf " | "
printf "%b" "${TARGET}: $(df -h "$TARGET" | awk ' /[0-9]/ {print $3 "/" $2}')"
first=false
done
printf "\n"

View File

@ -1,3 +1,3 @@
#!/bin/sh
printf "%b" "󰘚 "
free --mega | sed -n '2{p;q}' | awk '{printf ("%2.2fG/%2.2fG\n", ($3 / 1000), ($2 / 1000))}'
free -m | sed -n '2{p;q}' | awk '{printf ("%2.2fG/%2.2fG\n", ($3 / 1000), ($2 / 1000))}'