From 4fee9c21e3efe952dc23af0598ab6c3dc4b78a66 Mon Sep 17 00:00:00 2001 From: andrecoron <124372254+andrecoron@users.noreply.github.com> Date: Mon, 27 Feb 2023 11:21:48 +0100 Subject: [PATCH 1/8] add EDITOR line --- src/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.h b/src/config.h index 3870584..f609c95 100644 --- a/src/config.h +++ b/src/config.h @@ -4,6 +4,7 @@ #define UptimeText " UPTIME " // #define ShellText " SHELL " // #define PackageText " PKGS " // +#define EditorText " EDITOR " //󰧭 /* Those two options are mutually exclusive. * Either set one to 'true' or both to 'false'. */ From 4f443e9e1de377eec90ad04ea65aacd9f9b9878a Mon Sep 17 00:00:00 2001 From: andrecoron <124372254+andrecoron@users.noreply.github.com> Date: Mon, 27 Feb 2023 11:29:37 +0100 Subject: [PATCH 2/8] add EDITOR line --- src/fetch.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/fetch.c b/src/fetch.c index 3cfb582..3a3feeb 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -26,7 +26,7 @@ struct dist info = { .col8 = BWHITE "", .getPkgCount = "echo unsupported", }; -char *username, *osname, *shellname, *pkgCount; +char *username, *osname, *shellname, *pkgCount, *editorname; char *krnlver; long uptimeH, uptimeM; @@ -113,6 +113,13 @@ void *shell() return NULL; } +void *editor() +{ + editorname = getenv("EDITOR"); + + return NULL; +} + void *os() { static struct utsname sysInfo; @@ -536,13 +543,14 @@ int main() { struct utsname sysInfo; uname(&sysInfo); - pthread_t threads[6]; + pthread_t threads[7]; pthread_create(&threads[0], NULL, user, NULL); pthread_create(&threads[1], NULL, os, NULL); pthread_create(&threads[2], NULL, kernel, NULL); pthread_create(&threads[3], NULL, uptime, NULL); pthread_create(&threads[4], NULL, shell, NULL); + pthread_create(&threads[5], NULL, editor, NULL); pthread_join(threads[0], NULL); /* os function must be run to get info.col1 */ @@ -558,10 +566,10 @@ int main() pthread_join(threads[4], NULL); printf("%s %s%s%s\n", info.col6, ShellText, TextColour, shellname); printf("%s %s%s%s\n", info.col7, PackageText, TextColour, pkgCount); - printf("%s\n", info.col8); + printf("%s %s%s%s\n", info.col8, EditorText, TextColour, editorname); - pthread_create(&threads[5], NULL, colourDraw, NULL); - pthread_join(threads[5], NULL); + pthread_create(&threads[6], NULL, colourDraw, NULL); + pthread_join(threads[6], NULL); printf("%s", RESET); return 0; } From 03bc27ff8d3b8cda12df6267843d06511d292369 Mon Sep 17 00:00:00 2001 From: andrecoron <124372254+andrecoron@users.noreply.github.com> Date: Mon, 27 Feb 2023 11:37:55 +0100 Subject: [PATCH 3/8] removed newlines from any os logo --- src/fetch.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fetch.c b/src/fetch.c index 3a3feeb..258cd8d 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -181,7 +181,7 @@ void *os() info.col5 = BCYAN " / \\ "; info.col6 = BCYAN " / ,, \\ "; info.col7 = BCYAN " / | | -\\ "; - info.col8 = BCYAN "/_-'' ''-_\\\n"; + info.col8 = BCYAN "/_-'' ''-_\\"; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Arch bang Linux", 15) == 0) { @@ -192,7 +192,7 @@ void *os() info.col5 = BCYAN " / /_/\\ "; info.col6 = BCYAN " / __ \\ "; info.col7 = BCYAN " / /_/\\ \\ "; - info.col8 = BCYAN "/_-'' ''-_\\\n"; + info.col8 = BCYAN "/_-'' ''-_\\"; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "ArcoLinux", 9) == 0) { info.col1 = BBLUE ""; @@ -202,7 +202,7 @@ void *os() info.col5 = BBLUE " / / \\ \\ "; info.col6 = BBLUE " / / \\ \\ "; info.col7 = BBLUE " / / _____\\ \\ "; - info.col8 = BBLUE "/_/ `----.\\_\\\n"; + info.col8 = BBLUE "/_/ `----.\\_\\"; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Artix Linux", 11) == 0) { info.col1 = BCYAN ""; @@ -212,7 +212,7 @@ void *os() info.col5 = BCYAN " / ', "; info.col6 = BCYAN " / ,`\\ "; info.col7 = BCYAN " / ,.'`. \\ "; - info.col8 = BCYAN "/.,'` `'.\\\n"; + info.col8 = BCYAN "/.,'` `'.\\"; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "CelOS", 5) == 0) { info.col1 = BMAGENTA "\n"; @@ -222,7 +222,7 @@ void *os() info.col5 = BWHITE "__"BMAGENTA"|"BWHITE"_____"BMAGENTA" | "; info.col6 = BMAGENTA " | | "; info.col7 = BMAGENTA " -_"BWHITE" ______"BMAGENTA"/"BWHITE"_ "BMAGENTA; - info.col8 = BMAGENTA " -______/ \n"; + info.col8 = BMAGENTA " -______/ "; // have to add support for flatpak too info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; /* TO DO: CREATE DEEPIN LOGO */ @@ -309,7 +309,7 @@ void *os() info.col5 = BMAGENTA " / _/ "; info.col6 = BMAGENTA " ( _- "; info.col7 = BMAGENTA " \\____- "; - info.col8 = BWHITE "\n"; + info.col8 = BWHITE ""; info.getPkgCount = "qlist -IRv | wc -l"; } else if (strncmp(osname, "KDE neon", 8) == 0) { info.col1 = BGREEN ""; @@ -330,7 +330,7 @@ void *os() info.col5 = BGREEN " | | | | | | "; info.col6 = BGREEN " | \\_____/ | "; info.col7 = BGREEN " \\___________/ "; - info.col8 = BGREEN "\n"; + info.col8 = BGREEN ""; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Manjaro", 7) == 0) { info.col1 = BGREEN " ________ __ \n"; @@ -340,7 +340,7 @@ void *os() info.col5 = BGREEN "| | | | | |"; info.col6 = BGREEN "| | | | | |"; info.col7 = BGREEN "| | | | | |"; - info.col8 = BGREEN "|__| |__| |__|\n"; + info.col8 = BGREEN "|__| |__| |__|"; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "NixOS", 5) == 0) { info.col1 = BMAGENTA " \n"; @@ -439,7 +439,7 @@ void *os() info.col5 = BGREEN " | | " BGRAY BITAL "VOID " BGREEN "| |"; info.col6 = BGREEN " \\ \\ \\____/ / /"; info.col7 = BGREEN " \\ \\____ /_/ "; - info.col8 = BGREEN " -_____\\\n"; + info.col8 = BGREEN " -_____\\"; info.getPkgCount = "xbps-query -l | wc -l"; } else if (strncmp(osname, "Zorin OS", 8) == 0) { info.col1 = BBLUE " ______ \n"; From 9c1456b5d9476c24f5063a15b93d6ecd677759e5 Mon Sep 17 00:00:00 2001 From: andrecoron <124372254+andrecoron@users.noreply.github.com> Date: Mon, 27 Feb 2023 14:58:32 +0100 Subject: [PATCH 4/8] adapted logo fitting EDITOR line --- src/fetch.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/fetch.c b/src/fetch.c index 258cd8d..986306b 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -170,7 +170,7 @@ void *os() info.col5 = BBLUE " / \\ \\ "; info.col6 = BBLUE "/ \\ \\"; info.col7 = BBLUE " \\ "; - info.col8 = BBLUE ""; + info.col8 = BBLUE " "; info.getPkgCount = "grep 'P:' /lib/apk/db/installed | wc -l"; } else if (strncmp(osname, "Arch Linux", 10) == 0) { @@ -245,7 +245,7 @@ void *os() info.col5 = BRED "-_ "; info.col6 = BRED " --_ "; info.col7 = BRED " "; - info.col8 = BRED ""; + info.col8 = BRED " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Arch7", 10 ) == 0){ @@ -295,7 +295,7 @@ void *os() BBLUE "/ / " BWHITE "| | " BBLUE; info.col7 = BBLUE "\\ \\" BWHITE "__/ | " BBLUE; - info.col8 = BBLUE " \\" BWHITE "(_____/" BBLUE; + info.col8 = BBLUE " \\" BWHITE "(_____/ " BBLUE; info.getPkgCount = "[[ $(which sqlite3 2>/dev/null) && $? -ne " "1 ]] && (sqlite3 " @@ -330,7 +330,7 @@ void *os() info.col5 = BGREEN " | | | | | | "; info.col6 = BGREEN " | \\_____/ | "; info.col7 = BGREEN " \\___________/ "; - info.col8 = BGREEN ""; + info.col8 = BGREEN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Manjaro", 7) == 0) { info.col1 = BGREEN " ________ __ \n"; @@ -364,7 +364,7 @@ void *os() info.col5 = BGREEN " _______|"; info.col6 = BGREEN " \\_______"; info.col7 = BGREEN "__________/"; - info.col8 = BGREEN ""; + info.col8 = BGREEN " "; info.getPkgCount = "rpm -qa | wc -l"; } else if (strncmp(osname, "Parabola", 8) == 0) { info.col1 = BMAGENTA ""; @@ -374,7 +374,7 @@ void *os() info.col5 = BMAGENTA " / .` "; info.col6 = BMAGENTA " /.` "; info.col7 = BMAGENTA " /` "; - info.col8 = BMAGENTA ""; + info.col8 = BMAGENTA " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Pop!_OS", 7) == 0) { info.col1 = BCYAN "______\n"; @@ -406,7 +406,7 @@ void *os() info.col5 = BBLUE " ______| | "; info.col6 = BBLUE "| |________/ "; info.col7 = BBLUE "|____________"; - info.col8 = BBLUE ""; + info.col8 = BBLUE " "; info.getPkgCount = "ls /var/log/packages | wc -l"; } else if (strncmp(osname, "Solus", 5) == 0) { @@ -416,7 +416,8 @@ void *os() info.col4 = BMAGENTA " / / \\ \\ \\ "; info.col5 = BMAGENTA "| / \\ \\ |"; info.col6 = BMAGENTA " \\--------------/ "; - info.col7 = BMAGENTA " \\------------/ "; + info.col7 = BMAGENTA " \\------------/ "; _ \____ - USER yalo + info.col8 = BMAGENTA " \\----------/"; info.getPkgCount = "ls /var/lib/eopkg/package/ | wc -l"; @@ -428,7 +429,7 @@ void *os() info.col5 = BRED "(_) | | "; info.col6 = BRED " \\ --- _/ "; info.col7 = BRED " ---(_) "; - info.col8 = BRED ""; + info.col8 = BRED " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "void", 4) == 0) { @@ -439,7 +440,7 @@ void *os() info.col5 = BGREEN " | | " BGRAY BITAL "VOID " BGREEN "| |"; info.col6 = BGREEN " \\ \\ \\____/ / /"; info.col7 = BGREEN " \\ \\____ /_/ "; - info.col8 = BGREEN " -_____\\"; + info.col8 = BGREEN " -_____\\ "; info.getPkgCount = "xbps-query -l | wc -l"; } else if (strncmp(osname, "Zorin OS", 8) == 0) { info.col1 = BBLUE " ______ \n"; From c73f38e0464571d91a93d6282aee363adafd037f Mon Sep 17 00:00:00 2001 From: andrecoron <124372254+andrecoron@users.noreply.github.com> Date: Mon, 27 Feb 2023 15:00:24 +0100 Subject: [PATCH 5/8] corrected Void linux name typo --- src/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetch.c b/src/fetch.c index 986306b..c510be1 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -432,7 +432,7 @@ void *os() info.col8 = BRED " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; - } else if (strncmp(osname, "void", 4) == 0) { + } else if (strncmp(osname, "Void", 4) == 0) { info.col1 = BGREEN " _____\n"; info.col2 = BGREEN " _ \\____ - "; info.col3 = BGREEN " / / ____ \\ \\ "; From 0b1204de4fd525f61670e41474143b16fb119da1 Mon Sep 17 00:00:00 2001 From: andrecoron <124372254+andrecoron@users.noreply.github.com> Date: Mon, 27 Feb 2023 15:46:59 +0100 Subject: [PATCH 6/8] correct typo on my side --- src/fetch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fetch.c b/src/fetch.c index c510be1..188de8c 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -416,8 +416,7 @@ void *os() info.col4 = BMAGENTA " / / \\ \\ \\ "; info.col5 = BMAGENTA "| / \\ \\ |"; info.col6 = BMAGENTA " \\--------------/ "; - info.col7 = BMAGENTA " \\------------/ "; _ \____ - USER yalo - + info.col7 = BMAGENTA " \\------------/ "; info.col8 = BMAGENTA " \\----------/"; info.getPkgCount = "ls /var/lib/eopkg/package/ | wc -l"; From d59728e195e9ae4c551378f12e1a8f400653b4c4 Mon Sep 17 00:00:00 2001 From: 0ldude Date: Tue, 28 Feb 2023 13:44:33 +0100 Subject: [PATCH 7/8] detect DE/WM with XDG_CURRENT_DESKTOP --- src/config.h | 9 ++-- src/fetch.c | 127 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 85 insertions(+), 51 deletions(-) diff --git a/src/config.h b/src/config.h index f609c95..f01cad4 100644 --- a/src/config.h +++ b/src/config.h @@ -4,7 +4,8 @@ #define UptimeText " UPTIME " // #define ShellText " SHELL " // #define PackageText " PKGS " // -#define EditorText " EDITOR " //󰧭 +#define EditorText " EDITOR " //󰧭 +#define DeWmText " DE/WM " // /* Those two options are mutually exclusive. * Either set one to 'true' or both to 'false'. */ @@ -14,12 +15,12 @@ /* See options in colour.h file */ #define TextColour WHITE -#define PrintColours false /* must be either 'true' or 'false' */ -#define ColourCharacter "● " +#define PrintColours true /* must be either 'true' or 'false' */ +#define ColourCharacter "▀" /* Some examples of things you may want to use for your ColourCharacter ▀ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▉ ▊ ▋ ▌ ▍ ▎ ▏ - █ ▄ ▀ ● + █ ▄ ▀ ●  */ diff --git a/src/fetch.c b/src/fetch.c index 188de8c..d10a0a1 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -12,7 +12,7 @@ #include "config.h" struct dist { - char *col1, *col2, *col3, *col4, *col5, *col6, *col7, *col8; + char *col1, *col2, *col3, *col4, *col5, *col6, *col7, *col8, *col9; char *getPkgCount; }; struct dist info = { @@ -24,9 +24,10 @@ struct dist info = { .col6 = BWHITE " / \\ ", .col7 = BWHITE " / \\ ", .col8 = BWHITE "", + .col9 = BWHITE "", .getPkgCount = "echo unsupported", }; -char *username, *osname, *shellname, *pkgCount, *editorname; +char *username, *osname, *shellname, *pkgCount, *editorname, *dewmname; char *krnlver; long uptimeH, uptimeM; @@ -116,7 +117,14 @@ void *shell() void *editor() { editorname = getenv("EDITOR"); - + + return NULL; +} + +void *dewm() +{ + dewmname = getenv("XDG_CURRENT_DESKTOP"); + return NULL; } @@ -171,17 +179,19 @@ void *os() info.col6 = BBLUE "/ \\ \\"; info.col7 = BBLUE " \\ "; info.col8 = BBLUE " "; + info.col9 = BBLUE " "; info.getPkgCount = "grep 'P:' /lib/apk/db/installed | wc -l"; } else if (strncmp(osname, "Arch Linux", 10) == 0) { - info.col1 = BCYAN ""; - info.col2 = BCYAN " /\\ "; - info.col3 = BCYAN " / \\ "; - info.col4 = BCYAN " /\\ \\ "; - info.col5 = BCYAN " / \\ "; - info.col6 = BCYAN " / ,, \\ "; - info.col7 = BCYAN " / | | -\\ "; - info.col8 = BCYAN "/_-'' ''-_\\"; + info.col1 = BBLUE ""; + info.col2 = BBLUE " /\\ "; + info.col3 = BBLUE " / \\ "; + info.col4 = BBLUE " /\\ \\ "; + info.col5 = BBLUE " / \\ "; + info.col6 = BBLUE " / ,, \\ "; + info.col7 = BBLUE " / | | -\\ "; + info.col8 = BBLUE "/_-'' ''-_\\"; + info.col9 = BBLUE " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Arch bang Linux", 15) == 0) { @@ -193,6 +203,7 @@ void *os() info.col6 = BCYAN " / __ \\ "; info.col7 = BCYAN " / /_/\\ \\ "; info.col8 = BCYAN "/_-'' ''-_\\"; + info.col9 = BCYAN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "ArcoLinux", 9) == 0) { info.col1 = BBLUE ""; @@ -203,6 +214,7 @@ void *os() info.col6 = BBLUE " / / \\ \\ "; info.col7 = BBLUE " / / _____\\ \\ "; info.col8 = BBLUE "/_/ `----.\\_\\"; + info.col9 = BBLUE " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Artix Linux", 11) == 0) { info.col1 = BCYAN ""; @@ -213,6 +225,7 @@ void *os() info.col6 = BCYAN " / ,`\\ "; info.col7 = BCYAN " / ,.'`. \\ "; info.col8 = BCYAN "/.,'` `'.\\"; + info.col9 = BCYAN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "CelOS", 5) == 0) { info.col1 = BMAGENTA "\n"; @@ -223,6 +236,7 @@ void *os() info.col6 = BMAGENTA " | | "; info.col7 = BMAGENTA " -_"BWHITE" ______"BMAGENTA"/"BWHITE"_ "BMAGENTA; info.col8 = BMAGENTA " -______/ "; + info.col9 = BMAGENTA " "; // have to add support for flatpak too info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; /* TO DO: CREATE DEEPIN LOGO */ @@ -235,6 +249,7 @@ void *os() info.col6 = BRED ""; info.col7 = BRED ""; info.col8 = BRED ""; + info.col9 = BRED ""; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Debian GNU/Linux", 16) == 0) { @@ -246,6 +261,7 @@ void *os() info.col6 = BRED " --_ "; info.col7 = BRED " "; info.col8 = BRED " "; + info.col9 = BRED " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Arch7", 10 ) == 0){ @@ -256,7 +272,8 @@ void *os() info.col5 = BCYAN " / /__\\ \\ "; info.col6 = BCYAN " / /____\\ \\ "; info.col7 = BCYAN " /_/ \\_\\ "; - info.col8 = BCYAN ""; + info.col8 = BCYAN " "; + info.col9 = BCYAN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "elementary OS", 12) == 0) { info.col1 = BCYAN ""; @@ -266,36 +283,31 @@ void *os() info.col5 = BCYAN "|__\\ / / |"; info.col6 = BCYAN "\\ /__/ /"; info.col7 = BCYAN " \\_______/ "; - info.col8 = BCYAN ""; + info.col8 = BCYAN " "; + info.col9 = BCYAN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "EndeavourOS", 11) == 0) { info.col1 = BCYAN ""; - info.col2 = - BRED " /" BBLUE "\\ " BCYAN; - info.col3 = BRED " /" BBLUE "/ \\" BCYAN - "\\ " BCYAN; - info.col4 = BRED " /" BBLUE "/ \\ " BCYAN - "\\ " BCYAN; - info.col5 = BRED " / " BBLUE "/ _) " BCYAN - ")" BCYAN; - info.col6 = BRED "/_" BBLUE "/___-- " BCYAN - "__- " BCYAN; + info.col2 = BRED " /" BBLUE "\\ " BCYAN; + info.col3 = BRED " /" BBLUE "/ \\" BCYAN"\\ " BCYAN; + info.col4 = BRED " /" BBLUE "/ \\ " BCYAN"\\ " BCYAN; + info.col5 = BRED " / " BBLUE "/ _) " BCYAN")" BCYAN; + info.col6 = BRED "/_" BBLUE "/___-- " BCYAN"__- " BCYAN; info.col7 = BCYAN " /____-- " BCYAN; - info.col8 = BCYAN ""; + info.col8 = BCYAN " "; + info.col9 = BCYAN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Fedora", 6) == 0) { info.col1 = BWHITE " _____\n" BBLUE; info.col2 = BWHITE " / __)" BBLUE "\\ "; info.col3 = BWHITE " | / " BBLUE "\\ \\"; info.col4 = BWHITE " ___| |" BBLUE "__/ /"; - info.col5 = - BBLUE " / " BWHITE "(_ _)" BBLUE "_/ "; - info.col6 = - BBLUE "/ / " BWHITE "| | " BBLUE; - info.col7 = - BBLUE "\\ \\" BWHITE "__/ | " BBLUE; + info.col5 = BBLUE " / " BWHITE "(_ _)" BBLUE "_/ "; + info.col6 = BBLUE "/ / " BWHITE "| | " BBLUE; + info.col7 = BBLUE "\\ \\" BWHITE "__/ | " BBLUE; info.col8 = BBLUE " \\" BWHITE "(_____/ " BBLUE; + info.col9 = BBLUE " "; info.getPkgCount = "[[ $(which sqlite3 2>/dev/null) && $? -ne " "1 ]] && (sqlite3 " @@ -309,7 +321,8 @@ void *os() info.col5 = BMAGENTA " / _/ "; info.col6 = BMAGENTA " ( _- "; info.col7 = BMAGENTA " \\____- "; - info.col8 = BWHITE ""; + info.col8 = BMAGENTA " "; + info.col9 = BMAGENTA " "; info.getPkgCount = "qlist -IRv | wc -l"; } else if (strncmp(osname, "KDE neon", 8) == 0) { info.col1 = BGREEN ""; @@ -319,7 +332,8 @@ void *os() info.col5 = BGREEN " | | | |"; info.col6 = BGREEN " \\ --- _/ "; info.col7 = BGREEN " --- "; - info.col8 = BGREEN ""; + info.col8 = BGREEN " "; + info.col9 = BGREEN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Linux Mint", 10) == 0) { @@ -331,6 +345,7 @@ void *os() info.col6 = BGREEN " | \\_____/ | "; info.col7 = BGREEN " \\___________/ "; info.col8 = BGREEN " "; + info.col9 = BGREEN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Manjaro", 7) == 0) { info.col1 = BGREEN " ________ __ \n"; @@ -341,6 +356,7 @@ void *os() info.col6 = BGREEN "| | | | | |"; info.col7 = BGREEN "| | | | | |"; info.col8 = BGREEN "|__| |__| |__|"; + info.col9 = BGREEN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "NixOS", 5) == 0) { info.col1 = BMAGENTA " \n"; @@ -351,6 +367,7 @@ void *os() info.col6 = BMAGENTA " //\\\\___// "; info.col7 = BMAGENTA "// /\\\\ \\\\== "; info.col8 = BMAGENTA " // \\\\ \\\\ "; + info.col9 = BMAGENTA " "; info.getPkgCount = "nix-store -q --requisites " "/run/current-system/sw | wc -l"; @@ -364,7 +381,8 @@ void *os() info.col5 = BGREEN " _______|"; info.col6 = BGREEN " \\_______"; info.col7 = BGREEN "__________/"; - info.col8 = BGREEN " "; + info.col8 = BGREEN " "; + info.col9 = BGREEN " "; info.getPkgCount = "rpm -qa | wc -l"; } else if (strncmp(osname, "Parabola", 8) == 0) { info.col1 = BMAGENTA ""; @@ -374,7 +392,8 @@ void *os() info.col5 = BMAGENTA " / .` "; info.col6 = BMAGENTA " /.` "; info.col7 = BMAGENTA " /` "; - info.col8 = BMAGENTA " "; + info.col8 = BMAGENTA " "; + info.col9 = BMAGENTA " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Pop!_OS", 7) == 0) { info.col1 = BCYAN "______\n"; @@ -385,6 +404,7 @@ void *os() info.col6 = BCYAN " \\ \\ _ "; info.col7 = BCYAN " __\\_\\__(_)_ "; info.col8 = BCYAN " (___________)"; + info.col9 = BCYAN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "postmarketOS", 13) == 0) { @@ -396,6 +416,7 @@ void *os() info.col6 = BGREEN " / ___\\/ \\ "; info.col7 = BGREEN " / \\ \\ "; info.col8 = BGREEN "/_____/________\\"; + info.col9 = BGREEN " "; info.getPkgCount = "grep 'P:' /lib/apk/db/installed | wc -l"; } else if (strncmp(osname, "Slackware", 10) == 0) { @@ -406,7 +427,8 @@ void *os() info.col5 = BBLUE " ______| | "; info.col6 = BBLUE "| |________/ "; info.col7 = BBLUE "|____________"; - info.col8 = BBLUE " "; + info.col8 = BBLUE " "; + info.col9 = BBLUE " "; info.getPkgCount = "ls /var/log/packages | wc -l"; } else if (strncmp(osname, "Solus", 5) == 0) { @@ -418,6 +440,7 @@ void *os() info.col6 = BMAGENTA " \\--------------/ "; info.col7 = BMAGENTA " \\------------/ "; info.col8 = BMAGENTA " \\----------/"; + info.col9 = BMAGENTA " "; info.getPkgCount = "ls /var/lib/eopkg/package/ | wc -l"; } else if (strncmp(osname, "Ubuntu", 6) == 0) { @@ -428,7 +451,8 @@ void *os() info.col5 = BRED "(_) | | "; info.col6 = BRED " \\ --- _/ "; info.col7 = BRED " ---(_) "; - info.col8 = BRED " "; + info.col8 = BRED " "; + info.col9 = BRED " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Void", 4) == 0) { @@ -440,6 +464,7 @@ void *os() info.col6 = BGREEN " \\ \\ \\____/ / /"; info.col7 = BGREEN " \\ \\____ /_/ "; info.col8 = BGREEN " -_____\\ "; + info.col9 = BGREEN " "; info.getPkgCount = "xbps-query -l | wc -l"; } else if (strncmp(osname, "Zorin OS", 8) == 0) { info.col1 = BBLUE " ______ \n"; @@ -449,7 +474,8 @@ void *os() info.col5 = BBLUE "\\ / /"; info.col6 = BBLUE " \\ /___ / "; info.col7 = BBLUE " \\______/ "; - info.col8 = BBLUE ""; + info.col8 = BBLUE " "; + info.col9 = BBLUE " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } } else if (strncmp(sysInfo.sysname, "Darwin", 6) == 0) { @@ -461,6 +487,7 @@ void *os() info.col6 = BRED " :_________: " BYELLOW; info.col7 = BMAGENTA " :_________`-;" BYELLOW; info.col8 = BBLUE " `.__.-.__.' " BYELLOW; + info.col9 = BBLUE " "; if ((strncmp(sysInfo.machine, "iPhone", 6) == 0) || (strncmp(sysInfo.machine, "iPad", 4) == 0) || (strncmp(sysInfo.machine, "iPod", 4) == 0)) { info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; @@ -494,7 +521,8 @@ void *os() info.col5 = BRED "| |"; info.col6 = BRED " ; ; "; info.col7 = BRED " '-_____-' "; - info.col8 = BRED ""; + info.col8 = BRED " "; + info.col9 = BRED " "; info.getPkgCount = "pkg info | wc -l | tr -d ' '"; osname = sysInfo.sysname; } else if (strncmp(sysInfo.sysname, "OpenBSD", 7) == 0) { @@ -505,7 +533,8 @@ void *os() info.col5 = BYELLOW " |_ < ) 3 )"; info.col6 = BYELLOW " / \\ / "; info.col7 = BYELLOW " /-_____-\\ "; - info.col8 = BYELLOW ""; + info.col8 = BYELLOW " "; + info.col9 = BYELLOW " "; info.getPkgCount = "/bin/ls -1 /var/db/pkg/ | wc -l | tr -d ' '"; osname = sysInfo.sysname; @@ -526,11 +555,11 @@ void *colourDraw() if (PrintColours == false) return NULL; - printf(" "); - for (int i = 30; i < 38; i++) { - printf("\033[0;%dm %s", i, ColourCharacter); - } // print regular term colours - printf("\n "); + //printf(" "); + //for (int i = 30; i < 38; i++) { + // printf("\033[0;%dm %s", i, ColourCharacter); + //} // print regular term colours + printf("\n"); for (int i = 30; i < 38; i++) { printf("\033[1;%dm %s", i, ColourCharacter); } @@ -543,7 +572,7 @@ int main() { struct utsname sysInfo; uname(&sysInfo); - pthread_t threads[7]; + pthread_t threads[8]; pthread_create(&threads[0], NULL, user, NULL); pthread_create(&threads[1], NULL, os, NULL); @@ -551,6 +580,7 @@ int main() pthread_create(&threads[3], NULL, uptime, NULL); pthread_create(&threads[4], NULL, shell, NULL); pthread_create(&threads[5], NULL, editor, NULL); + pthread_create(&threads[6], NULL, dewm, NULL); pthread_join(threads[0], NULL); /* os function must be run to get info.col1 */ @@ -566,10 +596,13 @@ int main() pthread_join(threads[4], NULL); printf("%s %s%s%s\n", info.col6, ShellText, TextColour, shellname); printf("%s %s%s%s\n", info.col7, PackageText, TextColour, pkgCount); + pthread_join(threads[5], NULL); printf("%s %s%s%s\n", info.col8, EditorText, TextColour, editorname); - - pthread_create(&threads[6], NULL, colourDraw, NULL); pthread_join(threads[6], NULL); + printf("%s %s%s%s\n", info.col9, DeWmText, TextColour, dewmname); + + pthread_create(&threads[7], NULL, colourDraw, NULL); + pthread_join(threads[7], NULL); printf("%s", RESET); return 0; } From ee01e3e94f702a5d6ca29ce07409a5205f0ac79c Mon Sep 17 00:00:00 2001 From: 0ldude Date: Tue, 28 Feb 2023 14:22:23 +0100 Subject: [PATCH 8/8] color>>colour --- Makefile | 2 +- src/{colour.h => color.h} | 6 ++-- src/config.h | 11 ++++--- src/fetch.c | 65 +++++++++++++++++++++++++++++---------- 4 files changed, 58 insertions(+), 26 deletions(-) rename src/{colour.h => color.h} (88%) diff --git a/Makefile b/Makefile index 0617ead..589e9c9 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ PREFIX ?= /usr/local all: afetch -afetch: ${SRC} src/config.h src/colour.h +afetch: ${SRC} src/config.h src/color.h ${CC} ${CFLAGS} ${SRC} ${LDFLAGS} -o afetch debug: diff --git a/src/colour.h b/src/color.h similarity index 88% rename from src/colour.h rename to src/color.h index 8a45425..d037db2 100644 --- a/src/colour.h +++ b/src/color.h @@ -1,4 +1,4 @@ -/* BOLD COLOURS */ +/* BOLD COLORS */ #define BBLACK "\033[1;30m" #define BGRAY "\033[1;90m" #define BRED "\033[1;31m" @@ -8,7 +8,7 @@ #define BMAGENTA "\033[1;35m" #define BCYAN "\033[1;36m" #define BWHITE "\033[1;37m" -/* NORMAL COLOURS */ +/* NORMAL COLORS */ #define BLACK "\033[0;30m" #define RED "\033[0;31m" #define GREEN "\033[0;32m" @@ -19,4 +19,4 @@ #define WHITE "\033[0;37m" /* OTHER */ #define RESET "\033[0;m" -#define BITAL "\033[1;3m" +#define BITAL "\033[1;3m" diff --git a/src/config.h b/src/config.h index f01cad4..49bb6df 100644 --- a/src/config.h +++ b/src/config.h @@ -6,19 +6,20 @@ #define PackageText " PKGS " // #define EditorText " EDITOR " //󰧭 #define DeWmText " DE/WM " // +#define ColorsText " COLORS " //󰸌 /* Those two options are mutually exclusive. * Either set one to 'true' or both to 'false'. */ #define ForceLowerCase false #define ForceUpperCase false -/* See options in colour.h file */ -#define TextColour WHITE +/* See options in color.h file */ +#define Textcolor WHITE -#define PrintColours true /* must be either 'true' or 'false' */ -#define ColourCharacter "▀" +#define Printcolors true /* must be either 'true' or 'false' */ +#define colorCharacter "▀" -/* Some examples of things you may want to use for your ColourCharacter +/* Some examples of things you may want to use for your colorCharacter ▀ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▉ ▊ ▋ ▌ ▍ ▎ ▏ diff --git a/src/fetch.c b/src/fetch.c index d10a0a1..d95a980 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -8,11 +8,11 @@ #include #include -#include "colour.h" +#include "color.h" #include "config.h" struct dist { - char *col1, *col2, *col3, *col4, *col5, *col6, *col7, *col8, *col9; + char *col1, *col2, *col3, *col4, *col5, *col6, *col7, *col8, *col9, *col10; char *getPkgCount; }; struct dist info = { @@ -25,6 +25,7 @@ struct dist info = { .col7 = BWHITE " / \\ ", .col8 = BWHITE "", .col9 = BWHITE "", + .col10 = BWHITE "", .getPkgCount = "echo unsupported", }; char *username, *osname, *shellname, *pkgCount, *editorname, *dewmname; @@ -180,6 +181,7 @@ void *os() info.col7 = BBLUE " \\ "; info.col8 = BBLUE " "; info.col9 = BBLUE " "; + info.col10 = BBLUE " "; info.getPkgCount = "grep 'P:' /lib/apk/db/installed | wc -l"; } else if (strncmp(osname, "Arch Linux", 10) == 0) { @@ -192,6 +194,7 @@ void *os() info.col7 = BBLUE " / | | -\\ "; info.col8 = BBLUE "/_-'' ''-_\\"; info.col9 = BBLUE " "; + info.col10 = BBLUE " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Arch bang Linux", 15) == 0) { @@ -204,6 +207,7 @@ void *os() info.col7 = BCYAN " / /_/\\ \\ "; info.col8 = BCYAN "/_-'' ''-_\\"; info.col9 = BCYAN " "; + info.col10 = BCYAN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "ArcoLinux", 9) == 0) { info.col1 = BBLUE ""; @@ -215,6 +219,7 @@ void *os() info.col7 = BBLUE " / / _____\\ \\ "; info.col8 = BBLUE "/_/ `----.\\_\\"; info.col9 = BBLUE " "; + info.col10 = BBLUE " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Artix Linux", 11) == 0) { info.col1 = BCYAN ""; @@ -226,6 +231,7 @@ void *os() info.col7 = BCYAN " / ,.'`. \\ "; info.col8 = BCYAN "/.,'` `'.\\"; info.col9 = BCYAN " "; + info.col10 = BCYAN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "CelOS", 5) == 0) { info.col1 = BMAGENTA "\n"; @@ -237,6 +243,7 @@ void *os() info.col7 = BMAGENTA " -_"BWHITE" ______"BMAGENTA"/"BWHITE"_ "BMAGENTA; info.col8 = BMAGENTA " -______/ "; info.col9 = BMAGENTA " "; + info.col10 = BMAGENTA " "; // have to add support for flatpak too info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; /* TO DO: CREATE DEEPIN LOGO */ @@ -250,6 +257,7 @@ void *os() info.col7 = BRED ""; info.col8 = BRED ""; info.col9 = BRED ""; + info.col10 = BRED ""; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Debian GNU/Linux", 16) == 0) { @@ -262,6 +270,7 @@ void *os() info.col7 = BRED " "; info.col8 = BRED " "; info.col9 = BRED " "; + info.col10 = BRED " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Arch7", 10 ) == 0){ @@ -274,6 +283,7 @@ void *os() info.col7 = BCYAN " /_/ \\_\\ "; info.col8 = BCYAN " "; info.col9 = BCYAN " "; + info.col10 = BCYAN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "elementary OS", 12) == 0) { info.col1 = BCYAN ""; @@ -285,6 +295,7 @@ void *os() info.col7 = BCYAN " \\_______/ "; info.col8 = BCYAN " "; info.col9 = BCYAN " "; + info.col10 = BCYAN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "EndeavourOS", 11) == 0) { @@ -297,6 +308,7 @@ void *os() info.col7 = BCYAN " /____-- " BCYAN; info.col8 = BCYAN " "; info.col9 = BCYAN " "; + info.col10 = BCYAN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Fedora", 6) == 0) { info.col1 = BWHITE " _____\n" BBLUE; @@ -308,6 +320,7 @@ void *os() info.col7 = BBLUE "\\ \\" BWHITE "__/ | " BBLUE; info.col8 = BBLUE " \\" BWHITE "(_____/ " BBLUE; info.col9 = BBLUE " "; + info.col10 = BBLUE " "; info.getPkgCount = "[[ $(which sqlite3 2>/dev/null) && $? -ne " "1 ]] && (sqlite3 " @@ -323,6 +336,7 @@ void *os() info.col7 = BMAGENTA " \\____- "; info.col8 = BMAGENTA " "; info.col9 = BMAGENTA " "; + info.col10 = BMAGENTA " "; info.getPkgCount = "qlist -IRv | wc -l"; } else if (strncmp(osname, "KDE neon", 8) == 0) { info.col1 = BGREEN ""; @@ -334,6 +348,7 @@ void *os() info.col7 = BGREEN " --- "; info.col8 = BGREEN " "; info.col9 = BGREEN " "; + info.col10 = BGREEN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Linux Mint", 10) == 0) { @@ -346,6 +361,7 @@ void *os() info.col7 = BGREEN " \\___________/ "; info.col8 = BGREEN " "; info.col9 = BGREEN " "; + info.col10 = BGREEN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Manjaro", 7) == 0) { info.col1 = BGREEN " ________ __ \n"; @@ -357,6 +373,7 @@ void *os() info.col7 = BGREEN "| | | | | |"; info.col8 = BGREEN "|__| |__| |__|"; info.col9 = BGREEN " "; + info.col10 = BGREEN " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "NixOS", 5) == 0) { info.col1 = BMAGENTA " \n"; @@ -368,6 +385,7 @@ void *os() info.col7 = BMAGENTA "// /\\\\ \\\\== "; info.col8 = BMAGENTA " // \\\\ \\\\ "; info.col9 = BMAGENTA " "; + info.col10 = BMAGENTA " "; info.getPkgCount = "nix-store -q --requisites " "/run/current-system/sw | wc -l"; @@ -383,6 +401,7 @@ void *os() info.col7 = BGREEN "__________/"; info.col8 = BGREEN " "; info.col9 = BGREEN " "; + info.col10 = BGREEN " "; info.getPkgCount = "rpm -qa | wc -l"; } else if (strncmp(osname, "Parabola", 8) == 0) { info.col1 = BMAGENTA ""; @@ -394,6 +413,7 @@ void *os() info.col7 = BMAGENTA " /` "; info.col8 = BMAGENTA " "; info.col9 = BMAGENTA " "; + info.col10 = BMAGENTA " "; info.getPkgCount = "pacman -Qq | wc -l"; } else if (strncmp(osname, "Pop!_OS", 7) == 0) { info.col1 = BCYAN "______\n"; @@ -405,6 +425,7 @@ void *os() info.col7 = BCYAN " __\\_\\__(_)_ "; info.col8 = BCYAN " (___________)"; info.col9 = BCYAN " "; + info.col10 = BCYAN " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "postmarketOS", 13) == 0) { @@ -417,6 +438,7 @@ void *os() info.col7 = BGREEN " / \\ \\ "; info.col8 = BGREEN "/_____/________\\"; info.col9 = BGREEN " "; + info.col10 = BGREEN " "; info.getPkgCount = "grep 'P:' /lib/apk/db/installed | wc -l"; } else if (strncmp(osname, "Slackware", 10) == 0) { @@ -429,6 +451,7 @@ void *os() info.col7 = BBLUE "|____________"; info.col8 = BBLUE " "; info.col9 = BBLUE " "; + info.col10 = BBLUE " "; info.getPkgCount = "ls /var/log/packages | wc -l"; } else if (strncmp(osname, "Solus", 5) == 0) { @@ -441,6 +464,7 @@ void *os() info.col7 = BMAGENTA " \\------------/ "; info.col8 = BMAGENTA " \\----------/"; info.col9 = BMAGENTA " "; + info.col10 = BMAGENTA " "; info.getPkgCount = "ls /var/lib/eopkg/package/ | wc -l"; } else if (strncmp(osname, "Ubuntu", 6) == 0) { @@ -453,6 +477,7 @@ void *os() info.col7 = BRED " ---(_) "; info.col8 = BRED " "; info.col9 = BRED " "; + info.col10 = BRED " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } else if (strncmp(osname, "Void", 4) == 0) { @@ -465,6 +490,7 @@ void *os() info.col7 = BGREEN " \\ \\____ /_/ "; info.col8 = BGREEN " -_____\\ "; info.col9 = BGREEN " "; + info.col10 = BGREEN " "; info.getPkgCount = "xbps-query -l | wc -l"; } else if (strncmp(osname, "Zorin OS", 8) == 0) { info.col1 = BBLUE " ______ \n"; @@ -476,6 +502,7 @@ void *os() info.col7 = BBLUE " \\______/ "; info.col8 = BBLUE " "; info.col9 = BBLUE " "; + info.col10 = BBLUE " "; info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; } } else if (strncmp(sysInfo.sysname, "Darwin", 6) == 0) { @@ -488,6 +515,7 @@ void *os() info.col7 = BMAGENTA " :_________`-;" BYELLOW; info.col8 = BBLUE " `.__.-.__.' " BYELLOW; info.col9 = BBLUE " "; + info.col10 = BBLUE " "; if ((strncmp(sysInfo.machine, "iPhone", 6) == 0) || (strncmp(sysInfo.machine, "iPad", 4) == 0) || (strncmp(sysInfo.machine, "iPod", 4) == 0)) { info.getPkgCount = "dpkg -l | tail -n+6 | wc -l"; @@ -523,6 +551,7 @@ void *os() info.col7 = BRED " '-_____-' "; info.col8 = BRED " "; info.col9 = BRED " "; + info.col10 = BRED " "; info.getPkgCount = "pkg info | wc -l | tr -d ' '"; osname = sysInfo.sysname; } else if (strncmp(sysInfo.sysname, "OpenBSD", 7) == 0) { @@ -535,6 +564,7 @@ void *os() info.col7 = BYELLOW " /-_____-\\ "; info.col8 = BYELLOW " "; info.col9 = BYELLOW " "; + info.col10 = BYELLOW " "; info.getPkgCount = "/bin/ls -1 /var/db/pkg/ | wc -l | tr -d ' '"; osname = sysInfo.sysname; @@ -550,18 +580,18 @@ void *os() return NULL; } -void *colourDraw() +void *colorDraw() { - if (PrintColours == false) + if (Printcolors == false) return NULL; //printf(" "); //for (int i = 30; i < 38; i++) { - // printf("\033[0;%dm %s", i, ColourCharacter); - //} // print regular term colours - printf("\n"); + // printf("\033[0;%dm %s", i, colorCharacter); + //} // print regular term colors + //printf("\n"); for (int i = 30; i < 38; i++) { - printf("\033[1;%dm %s", i, ColourCharacter); + printf("\033[1;%dm %s", i, colorCharacter); } printf("\n"); @@ -586,22 +616,23 @@ int main() /* os function must be run to get info.col1 */ pthread_join(threads[1], NULL); printf("%s", info.col1); - printf("%s %s%s%s\n", info.col2, UserText, TextColour, username); - printf("%s %s%s%s\n", info.col3, OsText, TextColour, osname); + printf("%s %s%s%s\n", info.col2, UserText, Textcolor, username); + printf("%s %s%s%s\n", info.col3, OsText, Textcolor, osname); pthread_join(threads[2], NULL); - printf("%s %s%s%s\n", info.col4, KernelText, TextColour, krnlver); + printf("%s %s%s%s\n", info.col4, KernelText, Textcolor, krnlver); pthread_join(threads[3], NULL); - printf("%s %s%s%ldh %ldm\n", info.col5, UptimeText, TextColour, uptimeH, + printf("%s %s%s%ldh %ldm\n", info.col5, UptimeText, Textcolor, uptimeH, uptimeM); pthread_join(threads[4], NULL); - printf("%s %s%s%s\n", info.col6, ShellText, TextColour, shellname); - printf("%s %s%s%s\n", info.col7, PackageText, TextColour, pkgCount); + printf("%s %s%s%s\n", info.col6, ShellText, Textcolor, shellname); + printf("%s %s%s%s\n", info.col7, PackageText, Textcolor, pkgCount); pthread_join(threads[5], NULL); - printf("%s %s%s%s\n", info.col8, EditorText, TextColour, editorname); + printf("%s %s%s%s\n", info.col8, EditorText, Textcolor, editorname); pthread_join(threads[6], NULL); - printf("%s %s%s%s\n", info.col9, DeWmText, TextColour, dewmname); + printf("%s %s%s%s\n", info.col9, DeWmText, Textcolor, dewmname); + printf("%s %s", info.col10, ColorsText); - pthread_create(&threads[7], NULL, colourDraw, NULL); + pthread_create(&threads[7], NULL, colorDraw, NULL); pthread_join(threads[7], NULL); printf("%s", RESET); return 0;