all repos — slstatus @ b3e56066ed5349c6fd0afe1ac7cf5035e16a8a2f

my build of slstatus (tools.suckless.org/slstatus/)

Implement fmt_scaled for disk_* functions
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 23:14:55 +0200
commit

b3e56066ed5349c6fd0afe1ac7cf5035e16a8a2f

parent

35219d39caa5ab5e0b1c9e6d4a1cbb29a388842e

1 files changed, 3 insertions(+), 7 deletions(-)

jump to
M components/disk.ccomponents/disk.c

@@ -16,8 +16,7 @@ warn("statvfs '%s':", mnt);

return NULL; } - return bprintf("%f", - (float)fs.f_frsize * (float)fs.f_bavail / 1024 / 1024 / 1024); + return fmt_scaled(fs.f_frsize * fs.f_bavail); } const char *

@@ -44,8 +43,7 @@ warn("statvfs '%s':", mnt);

return NULL; } - return bprintf("%f", - (float)fs.f_frsize * (float)fs.f_blocks / 1024 / 1024 / 1024); + return fmt_scaled(fs.f_frsize * fs.f_blocks); } const char *

@@ -58,7 +56,5 @@ warn("statvfs '%s':", mnt);

return NULL; } - return bprintf("%f", - (float)fs.f_frsize * ((float)fs.f_blocks - - (float)fs.f_bfree) / 1024 / 1024 / 1024); + return fmt_scaled(fs.f_frsize * (fs.f_blocks - fs.f_bfree)); }