From: Siraaj Khandkar Date: Fri, 29 Jun 2018 16:15:40 +0000 (-0400) Subject: Use percentage given by df X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;ds=sidebyside;h=61ea94519031336d102db8150de02e9c93c88e4f;hp=1b554fcaa226aae6025e8d448504e8cee6e80d2f;p=khatus.git Use percentage given by df --- diff --git a/bin/khatus_show b/bin/khatus_show index e43b556..c54ff1e 100755 --- a/bin/khatus_show +++ b/bin/khatus_show @@ -44,10 +44,9 @@ disk=$( function round(n) {return int(n + 0.5)} $1 == "/dev/mapper/kubuntu--vg-root" { - total = $2; - used = $3; + curr = $5; + sub("%$", "", curr); file = "/home/siraaj/var/run/status/disk_space_used_percentage"; - curr = round(used / total * 100); getline prev < file; print curr > file; if (curr > prev) {