This commit is contained in:
Your Name 2024-04-07 13:09:42 +03:00
parent 743123f9c5
commit 76e0dcb8ed
3 changed files with 16 additions and 24 deletions

View File

@ -9,32 +9,23 @@ typedef struct {
} PARAMETR;
/* 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 BAR_WIDTH 10
/* Uncomment if you use firacode font */
/* #define FIRA_CODE */
#define COLORS " \033[31m(>_<) \033[32m(OwO) \033[33m($w$) \033[34m(;~;)\033[0m"
#define FONT_COLOR "\033[0m"
/* Full path to capacity file */
/* Example: /sys/class/power_supply/battery/capacity */
#define BAR_WIDTH 1
#define BATT_NAME NULL
#ifdef _MAIN_H
PARAMETR CONFIG[] = {
{" os ", PrintOs},
{" kr ", GetKernel},
{" usr ", GetUser},
{" upt ", GetUptime},
{" arch ", GetArch},
{"shell ", GetShell},
{" pkgs ", GetPkg},
{" mem ", GetMem},
{"model ", GetModel},
{" host ", GetHostname},
{" lAVG ", GetAVG},
{" batt ", GetBattery},
{" ", Blank},
{COLORS, Blank}
{" -> ", PrintOs},
{" ", Blank},
{" <- ", GetUptime},
{" ", Blank},
{" -> ", GetMem},
{" ", Blank},
{" <- ", GetArch},
{" ", Blank},
{COLORS, Blank}
};
#endif

View File

@ -190,7 +190,7 @@ int GetMem(const char *title, const FETCH fetch) {
return 1;
off_t free = 0, total = 0, cached = 0, buffer = 0, unused = 0;
if (fscanf(fp, "MemTotal: %lu kB\nMemFree: %lu kB\nMemAvailable: %lu kB\nBuffers: %lu kB\nCached: %lu kB", &total, &free, &unused, &buffer, &cached) < 0)
if (fscanf(fp, "MemTotal: %ju kB\nMemFree: %ju kB\nMemAvailable: %ju kB\nBuffers: %ju kB\nCached: %ju kB", &total, &free, &unused, &buffer, &cached) < 0)
return 1;
fclose(fp);

View File

@ -22,7 +22,7 @@ int main(int argc, char **argv) {
case 'h':
default:
printf("kfetch [hl]\n\t[-h Help menu] [-l Dont print logo]\n\t[-d N Set N as distro name]\n");
printf("kfetch [-hld]\n\t-h Help menu\n\t-l Doesnt print logo\n\t-d N Set N as distro name\n");
return 0;
}
}
@ -57,7 +57,8 @@ int main(int argc, char **argv) {
}
for (; j < fetch.logo_size; j++)
printf("%s\n", fetch.logo[j]);
if (!l_flag)
printf("%s\n", fetch.logo[j]);
printf("\033[0m");
return 0;