fixed
This commit is contained in:
parent
a3a17c2b8b
commit
410f8ec2e8
1
config.h
1
config.h
@ -11,7 +11,6 @@ typedef struct {
|
||||
/* Config, EDIT THERE */
|
||||
#define COLORS "\033[31m<> \033[32m<> \033[33m<> \033[34m<> \033[35m<> \033[36m<>\033[0m"
|
||||
#define FONT_COLOR "\033[1;37m"
|
||||
#define PC_CHAR "<>"
|
||||
|
||||
/* #define PRINT_TOTAL_MEM */
|
||||
/* #define PRINT_USER_MEM */
|
||||
|
31
src/main.c
31
src/main.c
@ -34,41 +34,30 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
int flag = 0;
|
||||
size_t i = 0;
|
||||
for (i = 0; i < sizeof(CONFIG) / sizeof(PARAMETR); i++) {
|
||||
/* Logo print */
|
||||
if (i < fetch.logo_size && !flag && !l_flag)
|
||||
printf("%s", fetch.logo[i]);
|
||||
size_t j = 0;
|
||||
for (size_t i = 0; i < sizeof(CONFIG) / sizeof(PARAMETR); i++) {
|
||||
/* Print ascii logo */
|
||||
if (j < fetch.logo_size && !flag && !l_flag)
|
||||
printf("%s", fetch.logo[j]);
|
||||
|
||||
else if (i >= fetch.logo_size && !flag && !l_flag)
|
||||
else if (j >= fetch.logo_size && !flag && !l_flag)
|
||||
printf("%s", fetch.logo[fetch.logo_size - 1]);
|
||||
|
||||
/* Strip */
|
||||
char *title = CONFIG[i].title;
|
||||
if (l_flag) {
|
||||
size_t len = strlen(title);
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
if (title[0] != ' ')
|
||||
break;
|
||||
|
||||
title++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Function exec */
|
||||
if (CONFIG[i].func(title, fetch)) {
|
||||
if (CONFIG[i].func(CONFIG[i].title, fetch)) {
|
||||
flag = 1;
|
||||
printf("\033[0m");
|
||||
}
|
||||
|
||||
else {
|
||||
flag = 0;
|
||||
j++;
|
||||
printf("\033[0m\n");
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < fetch.logo_size; i++)
|
||||
printf("%s\n", fetch.logo[i]);
|
||||
for (; j < fetch.logo_size; j++)
|
||||
printf("%s\n", fetch.logo[j]);
|
||||
|
||||
printf("\033[0m");
|
||||
return 0;
|
||||
|
@ -11,7 +11,6 @@ typedef struct {
|
||||
/* Config, EDIT THERE */
|
||||
#define COLORS "\033[31m<> \033[32m<> \033[33m<> \033[34m<> \033[35m<> \033[36m<>\033[0m"
|
||||
#define FONT_COLOR "\033[1;37m"
|
||||
#define PC_CHAR "<>"
|
||||
|
||||
/* #define PRINT_TOTAL_MEM */
|
||||
/* #define PRINT_USER_MEM */
|
||||
|
@ -11,7 +11,6 @@ typedef struct {
|
||||
/* Config, EDIT THERE */
|
||||
#define COLORS " \033[31mx \033[32mx \033[33mx \033[34mx \033[35mx \033[0m"
|
||||
#define FONT_COLOR "\033[1;37m"
|
||||
#define PC_CHAR "<>"
|
||||
|
||||
/* #define PRINT_TOTAL_MEM */
|
||||
/* #define PRINT_USER_MEM */
|
||||
|
32
themes/mini.h
Normal file
32
themes/mini.h
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef _CONFIG_H
|
||||
#define _CONFIG_H
|
||||
|
||||
#include "fetch.h"
|
||||
|
||||
typedef struct {
|
||||
char *title;
|
||||
int (*func)(const char *title, const FETCH fetch);
|
||||
} PARAMETR;
|
||||
|
||||
/* Config, EDIT THERE */
|
||||
#define COLORS " \033[31mx \033[32mx \033[33mx \033[34mx \033[35mx \033[0m"
|
||||
#define FONT_COLOR "\033[1;37m"
|
||||
|
||||
/* #define PRINT_TOTAL_MEM */
|
||||
/* #define PRINT_USER_MEM */
|
||||
#define PRINT_USED_AND_TOTAL_MEM
|
||||
|
||||
#ifdef _MAIN_H
|
||||
PARAMETR CONFIG[] = {
|
||||
{" ", Blank},
|
||||
{" arch ", GetArch},
|
||||
{" upt ", GetUptime},
|
||||
{" pkgs ", GetPkg},
|
||||
{" os ", PrintOs},
|
||||
{" ", Blank},
|
||||
{COLORS, Blank}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@ -11,7 +11,6 @@ typedef struct {
|
||||
/* Config, EDIT THERE */
|
||||
#define COLORS " \033[41;31m++ \033[42;32m++ \033[43;33m++ \033[44;34m++ \033[45;35m++ \033[46;36m++\033[0m"
|
||||
#define FONT_COLOR "\033[1;37m"
|
||||
#define PC_CHAR "<>"
|
||||
|
||||
/* #define PRINT_TOTAL_MEM */
|
||||
/* #define PRINT_USER_MEM */
|
||||
|
Loading…
Reference in New Issue
Block a user