// vim:ts=8:expandtab #include #include #include #include #include #include #include #include #include "i3status.h" /* * Returns the correct color format for dzen (^fg(color)) or xmobar () * */ char *color(const char *colorstr) { static char colorbuf[32]; if (!cfg_getbool(cfg_general, "colors")) { colorbuf[0] = '\0'; return colorbuf; } #ifdef DZEN (void)snprintf(colorbuf, sizeof(colorbuf), "^fg(%s)", colorstr); #elif XMOBAR (void)snprintf(colorbuf, sizeof(colorbuf), "", colorstr); #endif return colorbuf; } /* * Some color formats (xmobar) require to terminate colors again * */ char *endcolor() { #ifdef XMOBAR return ""; #else return ""; #endif } void print_seperator() { #if defined(DZEN) || defined(XMOBAR) printf("%s", BAR); #endif }