]> git.sur5r.net Git - i3/i3status/blobdiff - src/output.c
Implement the i3bar JSON protocol
[i3/i3status] / src / output.c
index c0c1480bcbed785bf6f0ee03ac9327379df7b9a4..96dd3e498073ffe6286d5ce4b194ceb6046671b6 100644 (file)
@@ -24,6 +24,8 @@ char *color(const char *colorstr) {
                 (void)snprintf(colorbuf, sizeof(colorbuf), "^fg(%s)", cfg_getstr(cfg_general, colorstr));
         else if (output_format == O_XMOBAR)
                 (void)snprintf(colorbuf, sizeof(colorbuf), "<fc=%s>", cfg_getstr(cfg_general, colorstr));
+        else if (output_format == O_I3BAR)
+                (void)snprintf(colorbuf, sizeof(colorbuf), "\"color\":\"%s\", ", cfg_getstr(cfg_general, colorstr));
 
         return colorbuf;
 }
@@ -43,6 +45,8 @@ void print_seperator() {
                 printf("^fg(%s)^p(5;-2)^ro(2)^p()^fg()^p(5)", cfg_getstr(cfg_general, "color_separator"));
         else if (output_format == O_XMOBAR)
                 printf("<fc=%s> | </fc>", cfg_getstr(cfg_general, "color_separator"));
+        else if (output_format == O_I3BAR)
+                printf(", ");
         else if (output_format == O_NONE)
                 printf(" | ");
 }