From e4aef3bd133a237d27a88ce15b29572613682f35 Mon Sep 17 00:00:00 2001 From: Abhiraj Rik <133798548+abrik1@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:35:44 +0530 Subject: [PATCH] thanks to @jtbx for smaller code --- tinyfetch.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tinyfetch.c b/tinyfetch.c index 25bbede..c6586c6 100644 --- a/tinyfetch.c +++ b/tinyfetch.c @@ -2,14 +2,10 @@ #include int main(void){ - printf("\x1b[31muser:\x1b[0m "); - printf(getenv("USER")); - printf("\n\x1b[32msh: \x1b[0m"); - printf(getenv("SHELL")); - printf("\n\x1b[33mterm:\x1b[0m "); - printf(getenv("TERM")); - printf("\n\x1b[34mlocale:\x1b[0m "); - printf(getenv("LANG")); - printf("\n\x1b[35mcolors: \x1b[31m▅▅\x1b[32m▅▅\x1b[33m▅▅\x1b[34m▅▅\x1b[35m▅▅\x1b[0m\n"); - return 0; + printf("\x1b[31muser:\x1b[0m %s\n", getenv("USER")); + printf("\x1b[32msh:\x1b[0m %s\n", getenv("SHELL")); + printf("\x1b[33mterm:\x1b[0m %s\n", getenv("TERM")); + printf("\x1b[34mlocale:\x1b[0m %s\n", getenv("LANG")); + printf("\x1b[35mcolors: \x1b[0m\x1b[41m \x1b[42m \x1b[43m \x1b[44m \x1b[45m \x1b[0m\n"); + return 0; }