Загрузить файлы в «/»

This commit is contained in:
8nlight 2023-10-19 14:39:46 +03:00
parent 92fecf6370
commit 8846c69f1d
2 changed files with 28 additions and 2 deletions

14
funcs.h
View File

@ -112,11 +112,20 @@ void GetPkgs(void) {
}
FILE *fp = popen(Logo.pkg_cmd, "r");
if (fp == NULL) {
printf("%sPKGS \033[0;37m0", Logo.color);
return;
}
printf("%sPKGS \033[0;37m", Logo.color);
char ch;
while ((ch = fgetc(fp)) != '\n')
while ((ch = fgetc(fp))) {
if (feof(fp) || ch == '\n')
break;
printf("%c", ch);
}
pclose(fp);
}
@ -197,6 +206,9 @@ LOGO GetArt(void) {
SetArt(&art, sizeof(Arch) / sizeof(char *), "pacman -Qq | wc -l", Arch, "\033[0;34m");
}
else if (1)
SetArt(&art, sizeof(Android) / sizeof(char *), "dpkg -l | tail -n+6 | wc -l", Android, "\033[32m");
else
SetArt(&art, sizeof(Unknow) / sizeof(char *), NULL, Unknow, "\033[1;36m");

14
logos.h
View File

@ -1,3 +1,6 @@
#ifndef LOGOS_H
#define LOGOS_H
char *Debian[] = {
"\033[31m _____ ",
"\033[31m / __ \\ ",
@ -39,6 +42,16 @@ char *Arch[] = {
" "
};
char *Android[] = {
"\033[32m ;, ,; ",
"\033[32m ';,.-----.,;' ",
"\033[32m ,' ', ",
"\033[32m / O O \\ ",
"\033[32m| | ",
"\033[32m'-----------------' ",
" ",
};
char *Unknow[] = {
"\033[1;36m ___ ",
"\033[1;36m (\033[0m..\033[1;36m | ",
@ -50,3 +63,4 @@ char *Unknow[] = {
" "
};
#endif