updated disk status to print 2 decimal places
This commit is contained in:
parent
067fb9715e
commit
7f33ea540b
10
scripts/xmobar-status-disk
Executable file
10
scripts/xmobar-status-disk
Executable 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
|
||||
Reference in New Issue
Block a user