ubuntu support, fix GetArt debian family

This commit is contained in:
Your Name 2023-12-13 14:15:23 +03:00
parent b75d33b275
commit f2d507fdb9
2 changed files with 15 additions and 2 deletions

View File

@ -72,6 +72,16 @@ char *PlainOs[] = {
" "
};
char *Ubuntu[] = {
"\033[1;32m _ ",
"\033[1;32m ---(_) ",
"\033[1;32m _/ --- \\ ",
"\033[1;32m(_) | | ",
"\033[1;32m \\ --- _/ ",
"\033[1;32m ---(_) ",
" ",
};
char *Unknow[] = {
"\033[1;36m ___ ",
"\033[1;36m (\033[0m..\033[1;36m | ",

View File

@ -55,7 +55,7 @@ void SetArt(FETCH *fetch, size_t size, char *pkg_cmd, char **logo, char *color)
void GetArt(FETCH *fetch) {
if (strstr(fetch->os_name, "Debian"))
SetArt(fetch, sizeof(Debian), "dpkg -l | tail -n+6 | wc -l", Debian, "\033[0;31m");
SetArt(fetch, sizeof(Debian), "dpkg -l | tail -n+6 | wc -l | tr -d ' '", Debian, "\033[0;31m");
else if (strstr(fetch->os_name, "Void"))
SetArt(fetch, sizeof(Void), "xbps-query -l | wc -l", Void, "\033[0;32m");
@ -72,8 +72,11 @@ void GetArt(FETCH *fetch) {
else if (strstr(fetch->os_name, "OpenBSD"))
SetArt(fetch, sizeof(OpenBSD), "/bin/ls -1 /var/db/pkg/ | wc -l | tr -d ' '", OpenBSD, "\033[1;33m");
else if (strstr(fetch->os_name, "Ubuntu"))
SetArt(fetch, sizeof(Ubuntu), "dpkg -l | tail -n+6 | wc -l | tr -d ' '", Ubuntu, "\033[1;32m");
else if (!chdir("/system"))
SetArt(fetch, sizeof(Android), "dpkg -l | tail -n+6 | wc -l", Android, "\033[32m");
SetArt(fetch, sizeof(Android), "dpkg -l | tail -n+6 | wc -l | tr -d ' '", Android, "\033[32m");
else
SetArt(fetch, sizeof(Unknow), NULL, Unknow, "\033[1;36m");