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