From 7636ebb1490676685217d3191cdf0671a6789032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Thu, 7 May 2015 22:55:11 +0200 Subject: [PATCH] degesch: add a fancy logo It's all about the looks, man. --- degesch.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/degesch.c b/degesch.c index a211c36..95855cb 100644 --- a/degesch.c +++ b/degesch.c @@ -5870,6 +5870,30 @@ init_poller_events (struct app_context *ctx) poller_fd_set (&ctx->tty_event, POLLIN); } +static void +display_logo (void) +{ + const char *logo = + " __ __ \n" + " __/ / ____ ____ ____ ____ ____ / /_ \n" + " / / / , / / / / , / / __/ / __/ / __ \\ \n" + " / / / / __/ / / / / __/ /_ / / /_ / / / / \n" + " /___/ /___/ /_ / /___/ /___/ /___/ /_/ /_/ \n" + " /___/ \n" + " "; + + struct str_vector v; + str_vector_init (&v); + char *x = xstrdup_printf ("%s%s", + logo, PROGRAM_NAME " " PROGRAM_VERSION " starting"); + split_str (x, '\n', &v); + free (x); + + for (size_t i = 0; i < v.len; i++) + print_status ("%s", v.vector[i]); + str_vector_free (&v); +} + int main (int argc, char *argv[]) { @@ -5908,8 +5932,7 @@ main (int argc, char *argv[]) } opt_handler_free (&oh); - - print_status (PROGRAM_NAME " " PROGRAM_VERSION " starting"); + display_logo (); // We only need to convert to and from the terminal encoding setlocale (LC_CTYPE, "");