Use percentage given by df
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 29 Jun 2018 16:15:40 +0000 (12:15 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 29 Jun 2018 16:15:40 +0000 (12:15 -0400)
bin/khatus_show

index e43b556..c54ff1e 100755 (executable)
@@ -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) {
This page took 0.040734 seconds and 4 git commands to generate.