From 414c2133020eac3ef5888e68eecfc329aa129cb2 Mon Sep 17 00:00:00 2001 From: PK Date: Fri, 12 Mar 2021 16:18:29 -0600 Subject: [PATCH 1/3] Added Alpine + APK support --- uwufetch.c | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/uwufetch.c b/uwufetch.c index 18776e8..0eee71a 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -83,30 +83,33 @@ int main(int argc, char *argv[]) { } int pkgman() { // this is just a function that returns the total of installed packages - int apt, dnf, emerge, flatpak, nix, pacman, rpm, xbps, total = 0; + int apt, apk, dnf, emerge, flatpak, nix, pacman, rpm, xbps, total = 0; FILE *file[8]; file[0] = popen("dpkg-query -f '${binary:Package}\n' -W 2> /dev/null | wc -l", "r"); - file[1] = popen("dnf list installed 2> /dev/null | wc -l", "r"); - file[2] = popen("qlist -I 2> /dev/null | wc -l", "r"); - file[3] = popen("flatpak list 2> /dev/null | wc -l", "r"); - file[4] = popen("nix-store -q --requisites /run/current-sys_vartem/sw 2> /dev/null | wc -l", "r"); - file[5] = popen("pacman -Qq 2> /dev/null | wc -l", "r"); - file[6] = popen("rpm -qa --last 2> /dev/null | wc -l", "r"); - file[7] = popen("xbps-query -l 2> /dev/null | wc -l", "r"); + file[1] = popen("apk info 2> /dev/null | wc -l", "r"); + file[2] = popen("dnf list installed 2> /dev/null | wc -l", "r"); + file[3] = popen("qlist -I 2> /dev/null | wc -l", "r"); + file[4] = popen("flatpak list 2> /dev/null | wc -l", "r"); + file[5] = popen("nix-store -q --requisites /run/current-sys_vartem/sw 2> /dev/null | wc -l", "r"); + file[6] = popen("pacman -Qq 2> /dev/null | wc -l", "r"); + file[7] = popen("rpm -qa --last 2> /dev/null | wc -l", "r"); + file[8] = popen("xbps-query -l 2> /dev/null | wc -l", "r"); fscanf(file[0], "%d", &apt); - fscanf(file[1], "%d", &dnf); - fscanf(file[2], "%d", &emerge); - fscanf(file[3], "%d", &flatpak); - fscanf(file[4], "%d", &nix); - fscanf(file[5], "%d", &pacman); - fscanf(file[6], "%d", &rpm); - fscanf(file[7], "%d", &xbps); + fscanf(file[1], "%d", &apk); + fscanf(file[2], "%d", &dnf); + fscanf(file[3], "%d", &emerge); + fscanf(file[4], "%d", &flatpak); + fscanf(file[5], "%d", &nix); + fscanf(file[6], "%d", &pacman); + fscanf(file[7], "%d", &rpm); + fscanf(file[8], "%d", &xbps); for (int i = 0; i < 8; i++) fclose(file[i]); #define ADD_PACKAGES(package_count, pkgman_to_add) if (package_count > 0) { total += package_count; strcat(pkgman_name, pkgman_to_add); } ADD_PACKAGES(apt, "(apt)") + ADD_PACKAGES(apk, "(apk)") ADD_PACKAGES(dnf, "(dnf)") ADD_PACKAGES(emerge, "(emerge)") ADD_PACKAGES(flatpak,"(flatpak)") @@ -200,19 +203,26 @@ void list(char* arg) { // prints distribution list " %sDebian/%sUbuntu %sbased:\n" " %sdebian, %slinuxmint, %spopos\n\n" " %sOther/spare distributions:\n" - " %sfedora, %sgentoo, %svoid, android, %sunknown\n\n" + " %salpine, %sfedora, %sgentoo, %svoid, android, %sunknown\n\n" " %sBSD:\n" " freebsd, %sopenbsd\n", arg, BLUE, NORMAL, BLUE, GREEN, // Arch based colors RED, YELLOW, NORMAL, RED, GREEN, BLUE, // Debian based colors - NORMAL, BLUE, PINK, GREEN, WHITE, // Other/spare distributions colors + NORMAL, BLUE, BLUE, PINK, GREEN, WHITE, // Other/spare distributions colors RED, YELLOW); // BSD colors } void print_ascii() { // prints logo (as ascii art) of the given system. distributions listed alphabetically. // linux - if (strcmp(version_name, "arch") == 0) { + + if (strcmp(version_name, "alpine") == 0) { + printf("\033[2E\033[4C%s. .___.\n" + " / \\/ \\ /\n" + " /OwO\\ɛU\\/ __\n" + " / \\ \\__/ \\\n" + "/ \\ \\\n\n\n", BLUE); + } else if (strcmp(version_name, "arch") == 0) { printf( "\033[1E\033[8C%s/\\\n" " / \\\n" " /\\ \\\n" @@ -370,7 +380,8 @@ void uwu_name() { // changes distro name to uwufied(?) name #define STRING_TO_UWU(original, uwufied) if (strcmp(version_name, original) == 0) sprintf(version_name, "%s", uwufied) // linux - STRING_TO_UWU("arch", "Nyarch Linuwu"); + STRING_TO_UWU("alpine", "Nyalpine"); + else STRING_TO_UWU("arch", "Nyarch Linuwu"); else STRING_TO_UWU("artix", "Nyartix Linuwu"); else STRING_TO_UWU("debian", "Debinyan"); else STRING_TO_UWU("fedora", "Fedowa"); From af0f0f3db8fa68bf30938e6606e4ea1ca1880aaa Mon Sep 17 00:00:00 2001 From: PK Date: Fri, 12 Mar 2021 16:27:43 -0600 Subject: [PATCH 2/3] Modified Tux icon --- uwufetch.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/uwufetch.c b/uwufetch.c index 0eee71a..5096458 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -336,13 +336,13 @@ void print_ascii() { // prints logo (as ascii art) of the given system. distribu " /-________-\\ \n\n", YELLOW, RED, YELLOW, WHITE, YELLOW, LPINK, WHITE, LPINK, YELLOW); } - else printf( "\033[0E\033[4C%s.--.\n" - " |o_o |\n" - " |:_/ |\n" - " // \\ \\\n" - " (| | )\n" - " %s/'\\_ _/`\\\n" - " \\___)=(___/\n\n", WHITE, YELLOW); + else printf( "\033[0E\033[2C%s._.--._.\n" + " \\|>%s_%s< |/\n" + " |%s:_/%s |\n" + " // \\ \\ ?\n" + " (| | ) /\n" + " %s/'\\_ _/`\\%s-\n" + " %s\\___)=(___/\n\n", WHITE, YELLOW, WHITE, YELLOW, WHITE, YELLOW, WHITE, YELLOW); } void print_image() { // prints logo (as an image) of the given system. distributions listed alphabetically. From f9a1c886ea0629b6bc25f023fdd74dceb92bf65b Mon Sep 17 00:00:00 2001 From: PK Date: Fri, 12 Mar 2021 16:29:26 -0600 Subject: [PATCH 3/3] Added Nyalpine listing on README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f842546..af63a0c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A meme system info tool for (almost) all your Linux/Unix-based systems, based on ## Currently supported distros -Nyarch Linuwu, Nyartix Linuwu, Debinyan, Fedowa, GentOwO, Miwint, Myanjawo, Pop OwOs, UwUntu, and OwOid; Plus Nyandroid; and FweeBSD, and OwOpenBSD. +Nyalpine, Nyarch Linuwu, Nyartix Linuwu, Debinyan, Fedowa, GentOwO, Miwint, Myanjawo, Pop OwOs, UwUntu, and OwOid; Plus Nyandroid; FweeBSD, and OwOpenBSD. ## Building and installation