all repos — slstatus @ 49d1e5fae2e4957abcf0f1056b3e8df8d695094c

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

Fix ram_free for Linux
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 23:32:00 +0200
commit

49d1e5fae2e4957abcf0f1056b3e8df8d695094c

parent

39ee31c2425d3ff79f88808cabf44c305d6849ab

1 files changed, 5 insertions(+), 1 deletions(-)

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

@@ -9,7 +9,11 @@ ram_free(void)

{ long free; - return (pscanf("/proc/meminfo", "MemFree: %ld kB\n", &free) == 1) ? + return (pscanf("/proc/meminfo", + "MemTotal: %ld kB\n" + "MemFree: %ld kB\n" + "MemAvailable: %ld kB\n", + &free, &free, &free) == 3) ? bprintf("%f", (float)free / 1024 / 1024) : NULL; }