updated disk status to print 2 decimal places

This commit is contained in:
Solomon Laing 2022-07-26 13:45:39 +09:30
parent 067fb9715e
commit 7f33ea540b

10
scripts/xmobar-status-disk Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
freemb=$(df -h -B 1048576 | grep "/$" | awk -F ' ' '{ print $4 }')
freegb=$(df -h -B 1048576 | grep "/$" | awk -F ' ' '{ print $4/1024 }')
if [ $freemb -lt 1024 ]; then
printf "<fn=1></fn> %0.2fMb" $freemb
else
printf "<fn=1></fn> %0.2fGb" $freegb
fi