diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2009-10-24 13:27:02 +0200 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2009-10-24 13:27:02 +0200 |
commit | 013fdece8dbf31acf531b4745e335bb0edb56a2e (patch) | |
tree | 744fe406d455845a37fac9760af80e56f305436b /src/output.c | |
parent | 6cf90596649ecaea53d982ef2c02bf030117d33e (diff) |
Change output format to be a config option instead of a compile time define
Diffstat (limited to 'src/output.c')
-rw-r--r-- | src/output.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/output.c b/src/output.c index d4d8c2f..3d6666e 100644 --- a/src/output.c +++ b/src/output.c @@ -20,11 +20,11 @@ char *color(const char *colorstr) { colorbuf[0] = '\0'; return colorbuf; } -#ifdef DZEN - (void)snprintf(colorbuf, sizeof(colorbuf), "^fg(%s)", colorstr); -#elif XMOBAR - (void)snprintf(colorbuf, sizeof(colorbuf), "<fc=%s>", colorstr); -#endif + if (output_format == O_DZEN2) + (void)snprintf(colorbuf, sizeof(colorbuf), "^fg(%s)", colorstr); + else if (output_format == O_XMOBAR) + (void)snprintf(colorbuf, sizeof(colorbuf), "<fc=%s>", colorstr); + return colorbuf; } @@ -33,15 +33,16 @@ char *color(const char *colorstr) { * */ char *endcolor() { -#ifdef XMOBAR - return "</fc>"; -#else - return ""; -#endif + if (output_format == O_XMOBAR) + return "</fc>"; + else return ""; } void print_seperator() { -#if defined(DZEN) || defined(XMOBAR) - printf("%s", BAR); -#endif + if (output_format == O_DZEN2) + printf("^fg(#333333)^p(5;-2)^ro(2)^p()^fg()^p(5)"); + else if (output_format == O_XMOBAR) + printf("<fc=#333333> | </fc>"); + else if (output_format == O_NONE) + printf(" | "); } |