main.c fix logo print
This commit is contained in:
parent
e59cd1d2a0
commit
2f88885982
4
config.h
4
config.h
@ -9,7 +9,7 @@ typedef struct {
|
||||
} PARAMETR;
|
||||
|
||||
/* Config, EDIT THERE */
|
||||
#define FONT_COLOR "\033[37m"
|
||||
#define FONT_COLOR "\033[1;37m"
|
||||
#define PC_CHAR "%"
|
||||
|
||||
#ifdef _MAIN_H
|
||||
@ -21,7 +21,7 @@ PARAMETR CONFIG[] = {
|
||||
{" ARCH ", GetArch},
|
||||
{" SHELL ", GetShell},
|
||||
{" PKGS ", GetPkg},
|
||||
{" RAM ", GetMem},
|
||||
{" MEM ", GetMem},
|
||||
{" ", Blank},
|
||||
{" COLORS ", PrintColors}
|
||||
};
|
||||
|
@ -121,7 +121,8 @@ int GetUser(const char *title, const FETCH fetch) {
|
||||
int GetUptime(const char *title, const FETCH fetch) {
|
||||
#ifdef CLOCK
|
||||
struct timespec uptime;
|
||||
clock_gettime(CLOCK, &uptime);
|
||||
if (clock_gettime(CLOCK, &uptime) == -1)
|
||||
return 1;
|
||||
|
||||
int days = uptime.tv_sec / 86400;
|
||||
int hours = uptime.tv_sec / 3600;
|
||||
|
15
src/main.c
15
src/main.c
@ -6,20 +6,25 @@
|
||||
int main(void) {
|
||||
FETCH fetch = Init();
|
||||
|
||||
size_t i;
|
||||
int flag = 0;
|
||||
size_t i = 0;
|
||||
for (i = 0; i < sizeof(CONFIG) / sizeof(PARAMETR); i++) {
|
||||
if (i < fetch.logo_size)
|
||||
if (i < fetch.logo_size && !flag)
|
||||
printf("%s", fetch.logo[i]);
|
||||
|
||||
if (i >= fetch.logo_size)
|
||||
if (i >= fetch.logo_size && !flag)
|
||||
printf("%s", fetch.logo[fetch.logo_size - 1]);
|
||||
|
||||
if (!CONFIG[i].func(CONFIG[i].title, fetch))
|
||||
if (!CONFIG[i].func(CONFIG[i].title, fetch)) {
|
||||
flag = 0;
|
||||
printf("\033[0m\n");
|
||||
}
|
||||
|
||||
else
|
||||
else {
|
||||
flag = 1;
|
||||
printf("\033[0m");
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < fetch.logo_size; i++)
|
||||
printf("%s\n", fetch.logo[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user