diff options
author | June McEnroe <june@causal.agency> | 2020-12-13 23:09:21 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-12-13 23:09:21 -0500 |
commit | b1079dbd40f7f28b7459f2f9c27bc1a975c9b8c2 (patch) | |
tree | 09bb8e7dc3d8f132618443369827a21cfd76cfb0 | |
parent | Emulate catgirl in 16-color mode (diff) | |
download | litterbox-b1079dbd40f7f28b7459f2f9c27bc1a975c9b8c2.tar.gz litterbox-b1079dbd40f7f28b7459f2f9c27bc1a975c9b8c2.zip |
Color contexts like catgirl
Well, except for query contexts where the username is lost.
Diffstat (limited to '')
-rw-r--r-- | scoop.c | 11 |
1 files 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); |