Merge branch 'main' into better-uwufier
This commit is contained in:
commit
9d768667bf
3 changed files with 34 additions and 22 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
uwufetch
|
uwufetch
|
||||||
|
*.zip
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ A meme system info tool for (almost) all your Linux/Unix-based systems, based on
|
||||||
|
|
||||||
## Currently supported distros
|
## Currently supported distros
|
||||||
|
|
||||||
Nyarch Linuwu, Nyartix Linuwu, Debinyan, Fedowa, GentOwO, Miwint, Myanjawo, Pop OwOs, UwUntu, and Void; Plus Nyandroid; and FweeBSD, and OwOpenBSD.
|
Nyarch Linuwu, Nyartix Linuwu, Debinyan, Fedowa, GentOwO, Miwint, Myanjawo, Pop OwOs, UwUntu, and OwOid; Plus Nyandroid; and FweeBSD, and OwOpenBSD.
|
||||||
|
|
||||||
## Building and installation
|
## Building and installation
|
||||||
|
|
||||||
|
|
50
uwufetch.c
50
uwufetch.c
|
@ -106,29 +106,40 @@ int pkgman() { // this is just a function that returns the total of installed pa
|
||||||
fscanf(file[6], "%d", &rpm);
|
fscanf(file[6], "%d", &rpm);
|
||||||
fscanf(file[7], "%d", &xbps);
|
fscanf(file[7], "%d", &xbps);
|
||||||
for (int i = 0; i < 8; i++) fclose(file[i]);
|
for (int i = 0; i < 8; i++) fclose(file[i]);
|
||||||
|
|
||||||
if (apt > 0) { total += apt; strcat(pkgman_name, "(apt)"); }
|
#define ADD_PACKAGES(package_count, pkgman_to_add) if (package_count > 0) { total += package_count; strcat(pkgman_name, pkgman_to_add); }
|
||||||
if (dnf > 0) { total += dnf; strcat(pkgman_name, "(dnf)"); }
|
ADD_PACKAGES(apt, "(apt)")
|
||||||
if (emerge > 0) { total += emerge; strcat(pkgman_name, "(emerge)"); }
|
ADD_PACKAGES(dnf, "(dnf)")
|
||||||
if (flatpak > 0) { total += flatpak; strcat(pkgman_name, "(flatpak)"); }
|
ADD_PACKAGES(emerge, "(emerge)")
|
||||||
if (nix > 0) { total += nix; strcat(pkgman_name, "(nix)"); }
|
ADD_PACKAGES(flatpak,"(flatpak)")
|
||||||
if (pacman > 0) { total += pacman; strcat(pkgman_name, "(pacman)"); }
|
ADD_PACKAGES(nix, "(nix)")
|
||||||
if (rpm > 0) { total += rpm; strcat(pkgman_name, "(rpm)"); }
|
ADD_PACKAGES(pacman, "(pacman)")
|
||||||
if (xbps > 0) { total += xbps; strcat(pkgman_name, "(xbps)"); }
|
ADD_PACKAGES(rpm, "(rpm)")
|
||||||
|
ADD_PACKAGES(xbps, "(xbps)")
|
||||||
|
#undef ADD_PACKAGES
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_info() { // print collected info
|
void print_info() { // print collected info
|
||||||
printf("\033[9A\033[18C%s%s%s@%s\n", NORMAL, BOLD, user, host);
|
printf( "\033[9A\033[18C%s%s%s@%s\n"
|
||||||
printf("\033[17C %s%sOWOS %s%s\n", NORMAL, BOLD, NORMAL, version_name);
|
"\033[17C %s%sOWOS %s%s\n"
|
||||||
printf("\033[17C %s%sKERNEL %s%s %s\n", NORMAL, BOLD, NORMAL, sys_var.release, sys_var.machine);
|
"\033[17C %s%sKERNEL %s%s %s\n"
|
||||||
printf("\033[17C %s%sCPUWU %s%s\n", NORMAL, BOLD, NORMAL, cpu_model);
|
"\033[17C %s%sCPUWU %s%s\n"
|
||||||
printf("\033[17C %s%sWAM %s%ldM/%iM\n", NORMAL, BOLD, NORMAL, r_usage.ru_maxrss, ram_max);
|
"\033[17C %s%sWAM %s%ldM/%iM\n"
|
||||||
printf("\033[17C %s%sSHELL %s%s\n", NORMAL, BOLD, NORMAL, shell);
|
"\033[17C %s%sSHELL %s%s\n"
|
||||||
printf("\033[17C %s%sPKGS %s%s%d %s\n", NORMAL, BOLD, NORMAL, NORMAL, pkgs, pkgman_name);
|
"\033[17C %s%sPKGS %s%s%d %s\n"
|
||||||
printf("\033[17C %s%sUWUPTIME %s%lid, %lih, %lim\n", NORMAL, BOLD, NORMAL, sys.uptime/60/60/24, sys.uptime/60/60%24, sys.uptime/60%60);
|
"\033[17C %s%sUWUPTIME %s%lid, %lih, %lim\n"
|
||||||
printf("\033[17C %s%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\n", BOLD, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, NORMAL);
|
"\033[17C %s%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\n",
|
||||||
|
NORMAL, BOLD, user, host,
|
||||||
|
NORMAL, BOLD, NORMAL, version_name,
|
||||||
|
NORMAL, BOLD, NORMAL, sys_var.release, sys_var.machine,
|
||||||
|
NORMAL, BOLD, NORMAL, cpu_model,
|
||||||
|
NORMAL, BOLD, NORMAL, r_usage.ru_maxrss, ram_max,
|
||||||
|
NORMAL, BOLD, NORMAL, shell,
|
||||||
|
NORMAL, BOLD, NORMAL, NORMAL, pkgs, pkgman_name,
|
||||||
|
NORMAL, BOLD, NORMAL, sys.uptime/60/60/24, sys.uptime/60/60%24, sys.uptime/60%60,
|
||||||
|
BOLD, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_info() { // get all necessary info
|
void get_info() { // get all necessary info
|
||||||
|
@ -193,8 +204,7 @@ void list(char* arg) { // prints distribution list
|
||||||
arg, BLUE, NORMAL, BLUE, GREEN, // Arch based colors
|
arg, BLUE, NORMAL, BLUE, GREEN, // Arch based colors
|
||||||
RED, YELLOW, NORMAL, RED, GREEN, BLUE, // Debian based colors
|
RED, YELLOW, NORMAL, RED, GREEN, BLUE, // Debian based colors
|
||||||
NORMAL, BLUE, PINK, GREEN, WHITE, // Other/spare distributions colors
|
NORMAL, BLUE, PINK, GREEN, WHITE, // Other/spare distributions colors
|
||||||
RED, YELLOW // BSD colors
|
RED, YELLOW); // BSD colors
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_ascii() { // prints logo (as ascii art) of the given system. distributions listed alphabetically.
|
void print_ascii() { // prints logo (as ascii art) of the given system. distributions listed alphabetically.
|
||||||
|
|
Loading…
Reference in a new issue