Merge pull request #29 from prettykool/main

Nyalpine support + apk packages + Modified Tux icon
This commit is contained in:
TheDarkBug 2021-03-13 08:02:27 +01:00 committed by GitHub
commit 38899245e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 27 deletions

View file

@ -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

View file

@ -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"
@ -326,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.
@ -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");