--- a/Makefile.status.inc Mon Oct 20 23:00:01 2014 +0400
+++ b/Makefile.status.inc Mon Oct 20 23:24:03 2014 +0400
@@ -23,6 +23,6 @@
clean:
@echo cleaning ${OUT}
- @rm -f ${OUT} ${OBJ} ${CONFIG}
+ @rm -f ${OUT} ${OBJ}
.PHONY: all clean
--- a/status-loadavg/config.def.h Mon Oct 20 23:00:01 2014 +0400
+++ b/status-loadavg/config.def.h Mon Oct 20 23:24:03 2014 +0400
@@ -1,4 +1,4 @@
#define GREEN 1.0
#define ORANGE 4.0
-
#define UPDATE_PERIOD 15
+//#define PANGO_MARKUP
--- a/status-loadavg/loadavg.c Mon Oct 20 23:00:01 2014 +0400
+++ b/status-loadavg/loadavg.c Mon Oct 20 23:24:03 2014 +0400
@@ -12,12 +12,13 @@
{
while (1) {
double avgs[3];
- char *cols[3];
if (getloadavg(avgs, 3) < 0) {
perror("getloadavg");
exit(1);
}
+#ifdef PANGO_MARKUP
+ char *cols[3];
for ( int i = 0; i < 3; i++ ) {
if ( avgs[i] <= GREEN )
cols[i] = "color='green'";
@@ -29,6 +30,9 @@
printf("<span %s>%.2f</span> <span %s>%.2f</span> <span %s>%.2f</span>\n",
cols[0], avgs[0], cols[1], avgs[1], cols[2], avgs[2]);
+#else
+ printf("%.2f %.2f %.2f\n", avgs[0], avgs[1], avgs[2]);
+#endif
fflush(stdout);
sleep(UPDATE_PERIOD);
}
--- a/status-mem/config.def.h Mon Oct 20 23:00:01 2014 +0400
+++ b/status-mem/config.def.h Mon Oct 20 23:24:03 2014 +0400
@@ -2,3 +2,4 @@
#define ORANGE 0.8
#define RED 0.9
#define UPDATE_PERIOD 15
+//#define PANGO_MARKUP
--- a/status-mem/mem.c Mon Oct 20 23:00:01 2014 +0400
+++ b/status-mem/mem.c Mon Oct 20 23:24:03 2014 +0400
@@ -46,12 +46,16 @@
int used = total - free;
+#ifdef PANGO_MARKUP
char *color;
if (used*1.0/total < GREEN) color = "color='green'";
else if (used*1.0/total > RED) color = "color='red'";
else if (used*1.0/total > ORANGE) color = "color='orange'";
else color = "";
printf("<span %s>%d/%d</span>\n", color, used/1024, total/1024);
+#else
+ printf("%d/%d\n", used/1024, total/1024);
+#endif
fflush(stdout);
sleep(UPDATE_PERIOD);
}