kfetch/fetch.c
2023-08-01 22:41:49 +03:00

35 lines
653 B
C

#include <stdio.h>
#include "funcs.h"
int main(void) {
Init();
void (*FUNCS[])(void) = {PrintOs, GetKernel, GetShell, GetUptime, GetUser, GetPkgs, 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)
for (size_t j = 0; j < strlen(Logo.art[0]); j++)
printf(" ");
FUNCS[i]();
printf("\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;
}