From b1079dbd40f7f28b7459f2f9c27bc1a975c9b8c2 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 13 Dec 2020 23:09:21 -0500 Subject: Color contexts like catgirl Well, except for query contexts where the username is lost. --- scoop.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scoop.c b/scoop.c index f5b0692..8c113d5 100644 --- a/scoop.c +++ b/scoop.c @@ -145,11 +145,18 @@ static void formatColor(bool group, struct Event e) { static char network[256]; static char context[256]; if (group && (strcmp(e.network, network) || strcmp(e.context, context))) { - printf("%s%s/%s:\n", (network[0] ? "\n" : ""), e.network, e.context); + printf( + "%s\33[%dm%s/%s\33[m:\n", + (network[0] ? "\n" : ""), + code(color(e.context)), e.network, e.context + ); snprintf(network, sizeof(network), "%s", e.network); snprintf(context, sizeof(context), "%s", e.context); } else if (!group) { - printf("%s/%s: ", e.network, e.context); + printf( + "\33[%dm%s/%s\33[m: ", + code(color(e.context)), e.network, e.context + ); } printf("[%s] ", e.time); -- cgit 1.4.1