From 013fdece8dbf31acf531b4745e335bb0edb56a2e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 24 Oct 2009 13:27:02 +0200 Subject: Change output format to be a config option instead of a compile time define --- src/output.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src') 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), "", 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), "", colorstr); + return colorbuf; } @@ -33,15 +33,16 @@ char *color(const char *colorstr) { * */ char *endcolor() { -#ifdef XMOBAR - return ""; -#else - return ""; -#endif + if (output_format == O_XMOBAR) + return ""; + 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(" | "); + else if (output_format == O_NONE) + printf(" | "); } -- cgit v1.2.3