#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "common.h"
#include "tools.h"
memfree = atoi(&stline[17]);
stlen = getline(&stline, &stlen, stfile);
+ if (stlen > 13 && !memcmp(stline, "MemAvailable:", 13)) {
+ stlen = getline(&stline, &stlen, stfile);
+ }
membuffers = atoi(&stline[17]);
stlen = getline(&stline, &stlen, stfile);
/* Change color based on % of RAM used */
if ((float)memused / (float)memtotal < 0.85) {
- s.color = "green";
+ s.color = "#22FF22"; // green
} else {
- s.color = "red";
+ s.color = "#FF0000"; // red
}
snprintf(text, sizeof(text), "Mem: %d M", memused);