This commit is contained in:
Your Name 2024-01-03 15:24:33 +03:00
parent a3a17c2b8b
commit 410f8ec2e8
6 changed files with 42 additions and 25 deletions

View File

@ -11,7 +11,6 @@ typedef struct {
/* Config, EDIT THERE */ /* Config, EDIT THERE */
#define COLORS "\033[31m<> \033[32m<> \033[33m<> \033[34m<> \033[35m<> \033[36m<>\033[0m" #define COLORS "\033[31m<> \033[32m<> \033[33m<> \033[34m<> \033[35m<> \033[36m<>\033[0m"
#define FONT_COLOR "\033[1;37m" #define FONT_COLOR "\033[1;37m"
#define PC_CHAR "<>"
/* #define PRINT_TOTAL_MEM */ /* #define PRINT_TOTAL_MEM */
/* #define PRINT_USER_MEM */ /* #define PRINT_USER_MEM */

View File

@ -34,41 +34,30 @@ int main(int argc, char **argv) {
} }
int flag = 0; int flag = 0;
size_t i = 0; size_t j = 0;
for (i = 0; i < sizeof(CONFIG) / sizeof(PARAMETR); i++) { for (size_t i = 0; i < sizeof(CONFIG) / sizeof(PARAMETR); i++) {
/* Logo print */ /* Print ascii logo */
if (i < fetch.logo_size && !flag && !l_flag) if (j < fetch.logo_size && !flag && !l_flag)
printf("%s", fetch.logo[i]); 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]); 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 */ /* Function exec */
if (CONFIG[i].func(title, fetch)) { if (CONFIG[i].func(CONFIG[i].title, fetch)) {
flag = 1; flag = 1;
printf("\033[0m"); printf("\033[0m");
} }
else { else {
flag = 0; flag = 0;
j++;
printf("\033[0m\n"); printf("\033[0m\n");
} }
} }
for (; i < fetch.logo_size; i++) for (; j < fetch.logo_size; j++)
printf("%s\n", fetch.logo[i]); printf("%s\n", fetch.logo[j]);
printf("\033[0m"); printf("\033[0m");
return 0; return 0;

View File

@ -11,7 +11,6 @@ typedef struct {
/* Config, EDIT THERE */ /* Config, EDIT THERE */
#define COLORS "\033[31m<> \033[32m<> \033[33m<> \033[34m<> \033[35m<> \033[36m<>\033[0m" #define COLORS "\033[31m<> \033[32m<> \033[33m<> \033[34m<> \033[35m<> \033[36m<>\033[0m"
#define FONT_COLOR "\033[1;37m" #define FONT_COLOR "\033[1;37m"
#define PC_CHAR "<>"
/* #define PRINT_TOTAL_MEM */ /* #define PRINT_TOTAL_MEM */
/* #define PRINT_USER_MEM */ /* #define PRINT_USER_MEM */

View File

@ -11,7 +11,6 @@ typedef struct {
/* Config, EDIT THERE */ /* Config, EDIT THERE */
#define COLORS " \033[31mx \033[32mx \033[33mx \033[34mx \033[35mx \033[0m" #define COLORS " \033[31mx \033[32mx \033[33mx \033[34mx \033[35mx \033[0m"
#define FONT_COLOR "\033[1;37m" #define FONT_COLOR "\033[1;37m"
#define PC_CHAR "<>"
/* #define PRINT_TOTAL_MEM */ /* #define PRINT_TOTAL_MEM */
/* #define PRINT_USER_MEM */ /* #define PRINT_USER_MEM */

32
themes/mini.h Normal file
View 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

View File

@ -11,7 +11,6 @@ typedef struct {
/* Config, EDIT THERE */ /* 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 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 FONT_COLOR "\033[1;37m"
#define PC_CHAR "<>"
/* #define PRINT_TOTAL_MEM */ /* #define PRINT_TOTAL_MEM */
/* #define PRINT_USER_MEM */ /* #define PRINT_USER_MEM */