kfetch/fetch.c

34 lines
650 B
C
Raw Normal View History

#include <stdio.h>
#include "funcs.h"
int main(void) {
Init();
2023-10-18 20:55:28 +00:00
void (*FUNCS[])(void) = {PrintOs, GetAvg, GetKernel, GetShell, GetUptime, GetUser, GetPkgs, GetArch, Blank, PrintColors};
size_t i;
for (i = 0; i < sizeof(FUNCS) / sizeof(void *); i++) {
if (i < Logo.size)
printf("%s", Logo.art[i]);
//If art is less than buffer size
else if (i >= Logo.size)
2023-10-18 20:55:28 +00:00
printf("%s", Logo.art[Logo.size - 1]);
FUNCS[i]();
2023-08-20 06:54:50 +00:00
printf("\033[0m\n");
}
//If art is larger than buffer size
for (size_t j = i; j < Logo.size; j++)
printf("%s\n", Logo.art[j]);
//Clean and close
printf("\n\033[0m");
if (Os != NULL)
free(Os);
return 0;
}