Hi --
Here's a patch to colorize the ethernet output for i3status. (Why are the
castings of printf() to void inconsistent? Which way is preferred?)
pete
diff -ruN i3status-2.0.orig/src/print_eth_info.c
i3status-2.0/src/print_eth_info.c
--- i3status-2.0.orig/src/print_eth_info.c 2009-10-27 15:33:42.000000000
-0400
+++ i3status-2.0/src/print_eth_info.c 2010-02-13 16:28:05.689011287 -0500
@@ -79,8 +79,12 @@
const char *ip_address = get_ip_addr(interface);
if (ip_address == NULL) {
+ printf("%s", color("#FF0000"));
printf("%s", format_down);
+ (void)printf("%s", endcolor());
return;
+ } else {
+ printf("%s", color("#00FF00"));
}
for (walk = format_up; *walk != '\0'; walk++) {
@@ -97,4 +101,6 @@
walk += strlen("speed");
}
}
+
+ (void)printf("%s", endcolor());
}