Merge pull request #6 from Billy02357/main

Add 4 new logos, add a 'SEPARATOR' and updated README.md
This commit is contained in:
PalanixYT 2021-06-17 17:54:46 +02:00 committed by GitHub
commit e9b0693dd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 175 additions and 31 deletions

View File

@ -14,6 +14,29 @@ Displaying package count currently only works with Pacman
Example:
![example output](logos/example.png)
Available Logos
------------
- Tux
- Big tux
- Arch Linux
- Artix Linux
- Debian GNU/Linux
- Devuan
- Fedora GNU/Linux
- FreeBSD
- Gentoo Linux
- GNU Guix
- Hyperbola GNU/Linux-libre
- Parabola GNU/Linux-libre
- Kiss
- Manjaro Linux
- Linux Mint
- OpenSUSE
- Pop\!_OS
- Qubes OS
- Redhat Linux
- Trisquel GNU/Linux
Configuration
-------------

View File

@ -4,6 +4,12 @@
#define ELEMENTS 19
//this is how many elements are to be printed in the info
// SEPARATOR is the string defined that wayfetch will print for every factor
#define SEPARATOR ":" // Example: "OS: Parabola x86_64"
// #define SEPARATOR "=>" // Example: "OS => Parabola x86_64"
// #define SEPARATOR "->" // Example: "OS -> Parabola x86_64"
// #define SEPARATOR "=" // Example: "OS = Parabola x86_64"
//usually color is defined by the logo
//#define COLOR
// BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE
@ -12,23 +18,23 @@
//here comes the order of elements
// info[0] and info[1] are reserved for the title and bar
void order() {
hname();
os();
host();
kernel();
spacing();
spacing();
get_up();
get_shell();
get_term();
get_packages();
get_wm();
spacing();
spacing();
get_cpu();
get_memory();
spacing();
spacing();
get_colors();
get_colors2();
hname();
os();
host();
kernel();
spacing();
spacing();
get_up();
get_shell();
get_term();
get_packages();
get_wm();
spacing();
spacing();
get_cpu();
get_memory();
spacing();
spacing();
get_colors();
get_colors2();
}

32
logos/opensuse.h Normal file
View File

@ -0,0 +1,32 @@
#include "../color.h"
#define COLOR GREEN
#define ROWS 19
char *logo[] = {
WHITE" .;ldkO0000Okdl;. "CLOSE,
WHITE" .;d00xl:^''''''^:ok00d;. "CLOSE,
WHITE" .d00l' 'o00d. "CLOSE,
WHITE" .d0Kd' "GREEN"Okxol:;,."WHITE" :O0d. "CLOSE,
WHITE" .OK"GREEN"KKK0kOKKKKKKKKKKOxo:,"WHITE" lKO. "CLOSE,
WHITE" ,0K"GREEN"KKKKKKKKKKKKKKK0P^"WHITE",,,"GREEN"^dx:"WHITE" ;00, "CLOSE,
WHITE".OK"GREEN"KKKKKKKKKKKKKKKk'"WHITE".oOPPb."GREEN"'0k."WHITE" cKO."CLOSE,
WHITE":KK"GREEN"KKKKKKKKKKKKKKK: "WHITE"kKx..dd"GREEN" lKd"WHITE" 'OK:"CLOSE,
WHITE"dKK"GREEN"KKKKKKKKKOx0KKKd "WHITE"^0KKKO'"GREEN" kKKc"WHITE" dKd"CLOSE,
WHITE"dKK"GREEN"KKKKKKKKKK;.;oOKx,.."WHITE"^"GREEN"..;kKKK0. "WHITE"dKd"CLOSE,
WHITE":KK"GREEN"KKKKKKKKKK0o;...^cdxxOK0O/^^' "WHITE".0K:"CLOSE,
WHITE" kKK"GREEN"KKKKKKKKKKKKK0x;,,......,;od "WHITE"lKk "CLOSE,
WHITE" '0K"GREEN"KKKKKKKKKKKKKKKKKKKK00KKOo^ "WHITE"c00' "CLOSE,
WHITE" 'kK"GREEN"KKOxddxkOO00000Okxoc;'' "WHITE".dKk' "CLOSE,
WHITE" l0Ko. .c00l' "CLOSE,
WHITE" 'l0Kk:. .;xK0l' "CLOSE,
WHITE" 'lkK0xl:;,,,,;:ldO0kl' "CLOSE,
WHITE" '^:ldxkkkkxdl:^' "CLOSE,
WHITE" "CLOSE,
};
//IMPORTANT: Always make the lines the same length. There shouldn't be any extra spaces, as they are added later on by the programm itself
//IMPORTANT: the last line should be only spaces with the same length as the other lines, ROWS should exclude the last line

30
logos/qubes.h Normal file
View File

@ -0,0 +1,30 @@
#include "../color.h"
#define COLOR MAGENTA
#define NAMECOLOR BLUE
#define ROWS 21
char *logo[] = {
BLUE " `..--..` "CLOSE,
BLUE " `.----------.` "CLOSE,
BLUE " `..----------------..` "CLOSE,
BLUE " `.------------------------.`` "CLOSE,
BLUE " `..-------------....-------------..` "CLOSE,
BLUE ".::----------..`` ``..----------:+: "CLOSE,
BLUE ":////:----..` `..---:/ossso "CLOSE,
BLUE ":///////:` `/osssssso "CLOSE,
BLUE ":///////: /ssssssso "CLOSE,
BLUE ":///////: /ssssssso "CLOSE,
BLUE ":///////: /ssssssso "CLOSE,
BLUE ":///////: /ssssssso "CLOSE,
BLUE ":///////: /ssssssso "CLOSE,
BLUE ":////////-` .:sssssssso "CLOSE,
BLUE ":///////////-.` `-/osssssssssso "CLOSE,
BLUE "`//////////////:-```.:+ssssssssssssso- "CLOSE,
BLUE " .-://////////////sssssssssssssso/-` "CLOSE,
BLUE " `.:///////////sssssssssssssso:. "CLOSE,
BLUE " .-:///////ssssssssssssssssss/`"CLOSE,
BLUE " `.:////ssss+/+ssssssssssss."CLOSE,
BLUE " `--//- `-/osssso/. "CLOSE,
" "
};
//IMPORTANT: Always make the lines the same length. There shouldn't be any extra spaces, as they are added later on by the programm itself
//IMPORTANT: the last line should be only spaces with the same length as the other lines, ROWS should exclude the last line

27
logos/redhat.h Normal file
View File

@ -0,0 +1,27 @@
#include "../color.h"
#define COLOR RED
#define ROWS 18
char *logo[] = {
" .MMM..:MMMMMMM ",
" MMMMMMMMMMMMMMMMMM ",
" MMMMMMMMMMMMMMMMMMMM. ",
" MMMMMMMMMMMMMMMMMMMMMM ",
" ,MMMMMMMMMMMMMMMMMMMMMM: ",
" MMMMMMMMMMMMMMMMMMMMMMMM ",
" .MMMM' MMMMMMMMMMMMMMMMMMMMMM ",
" MMMMMM `MMMMMMMMMMMMMMMMMMMM. ",
"MMMMMMMM MMMMMMMMMMMMMMMMMM . ",
"MMMMMMMMM. `MMMMMMMMMMMMM' MM. ",
"MMMMMMMMMMM. MMMM ",
"`MMMMMMMMMMMMM. ,MMMMM. ",
" `MMMMMMMMMMMMMMMMM. ,MMMMMMMM.",
" MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM",
" MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:",
" MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ",
" `MMMMMMMMMMMMMMMMMMMMMMMM: ",
" ``MMMMMMMMMMMMMMMMM' ",
" ",
};
//IMPORTANT: Always make the lines the same length. There shouldn't be any extra spaces, as they are added later on by the programm itself
//IMPORTANT: the last line should be only spaces with the same length as the other lines, ROWS should exclude the last line

27
logos/trisquel.h Normal file
View File

@ -0,0 +1,27 @@
#include "../color.h"
#define COLOR CYAN
#define NAMECOLOR BLUE
#define ROWS 19
char *logo[] = {
BLUE" ▄▄▄▄▄▄ ",
BLUE" ▄█████████▄ ",
BLUE" ▄▄▄▄▄▄ ████▀ ▀████ ",
BLUE" ▄██████████▄ ████▀ ▄▄ ▀███ ",
BLUE" ▄███▀▀ ▀▀████ ███▄ ▄█ ███",
BLUE"▄███ ▄▄▄ ████▄ ▀██████ ▄███",
BLUE"███ █▀▀██▄ █████▄ ▀▀ ▄████ ",
BLUE"▀███ ███ ███████▄▄ ▄▄██████ ",
BLUE" ▀███▄ ▄███ █████████████"CYAN"████▀ ",
BLUE" ▀█████████ ██████"CYAN"████▀▀▀ ",
" ▀▀███▀▀ ██████▀▀ ",
" ██████▀ ▄▄▄▄ ",
" █████▀ ████████ ",
" █████ ███▀ ▀███ ",
" ████▄ ██▄▄▄ ███ ",
" █████▄ ▀▀ ▄██ ",
" ██████▄▄▄████ ",
" ▀▀█████▀▀ ",
" ",
};
//IMPORTANT: Always make the lines the same length. There shouldn't be any extra spaces, as they are added later on by the programm itself
//IMPORTANT: the last line should be only spaces with the same length as the other lines, ROWS should exclude the last line

23
main.c
View File

@ -21,7 +21,7 @@ void os() {
FILE *os = fopen("/etc/os-release","r");
char buffer[150];
fscanf(os, "NAME=\"%[^\"]+", buffer);
snprintf(info[i], 149, COLOR"OS: "CLOSE"%s %s", buffer, u.machine);
snprintf(info[i], 149, COLOR"OS"SEPARATOR" "CLOSE"%s %s", buffer, u.machine);
fclose(os);
i += 1;
}
@ -30,7 +30,7 @@ void host() {
FILE *host = fopen("/sys/devices/virtual/dmi/id/product_name", "r");
char buffer[150];
fscanf(host, "%s", buffer);
snprintf( info[i], 149, COLOR"Host: "CLOSE"%s", buffer);
snprintf( info[i], 149, COLOR"Host"SEPARATOR" "CLOSE"%s", buffer);
fclose(host);
}
@ -46,22 +46,22 @@ void hname() {
}
void kernel() {
snprintf(info[i], 149, COLOR"Kernel: "CLOSE"%s", u.release);
snprintf(info[i], 149, COLOR"Kernel"SEPARATOR" "CLOSE"%s", u.release);
i += 1;
}
void get_up() {
float mins = sys.uptime / 60;
if((int) (mins / 60) == 0) {
snprintf(info[i], 149, COLOR"Uptime: "CLOSE"%d mins", (int)mins % 60);
snprintf(info[i], 149, COLOR"Uptime"SEPARATOR" "CLOSE"%d mins", (int)mins % 60);
} else {
snprintf(info[i], 149, COLOR"Uptime: "CLOSE"%d hours, %d mins", (int)(mins / 60), (int)mins % 60);
snprintf(info[i], 149, COLOR"Uptime"SEPARATOR" "CLOSE"%d hours, %d mins", (int)(mins / 60), (int)mins % 60);
}
i += 1;
}
void get_shell() {
snprintf(info[i], 149, COLOR"Shell: "CLOSE"%s", strrchr(getenv("SHELL"), '/') + 1);
snprintf(info[i], 149, COLOR"Shell"SEPARATOR" "CLOSE"%s", strrchr(getenv("SHELL"), '/') + 1);
i += 1;
}
@ -71,7 +71,7 @@ void spacing() {
}
void get_term() {
snprintf(info[i], 149, COLOR"Terminal: "CLOSE"%s", getenv("TERM"));
snprintf(info[i], 149, COLOR"Terminal"SEPARATOR" "CLOSE"%s", getenv("TERM"));
i += 1;
}
@ -130,7 +130,7 @@ cpufreq_fallback:
snprintf(info[i], 150, COLOR"CPU: "CLOSE"%s (%d) @ %.*f%s", cpu_model, num_cores, prec, freq, freq_unit);
snprintf(info[i], 150, COLOR"CPU"SEPARATOR" "CLOSE"%s (%d) @ %.*f%s", cpu_model, num_cores, prec, freq, freq_unit);
free(cpu_model);
i += 1;
}
@ -159,7 +159,7 @@ void get_memory() {
total_memory = total / 1024;
int percentage = (int) (100 * (used_memory / (double) total_memory));
snprintf( info[i], 149, COLOR"Memory: "CLOSE"%dMiB / %dMiB (%d%%)", used_memory, total_memory, percentage);
snprintf( info[i], 149, COLOR"Memory"SEPARATOR" "CLOSE"%dMiB / %dMiB (%d%%)", used_memory, total_memory, percentage);
i += 1;
}
@ -202,18 +202,17 @@ void get_packages() {
closedir(dirp);
snprintf(info[i], 150, COLOR"Packages: "CLOSE"%d", num_packages);
snprintf(info[i], 150, COLOR"Packages"SEPARATOR" "CLOSE"%d", num_packages);
i += 1;
}
void get_wm() {
snprintf(info[i], 150, COLOR"DE/WM: "CLOSE"%s", getenv("XDG_CURRENT_DESKTOP"));
snprintf(info[i], 150, COLOR"DE/WM"SEPARATOR" "CLOSE"%s", getenv("XDG_CURRENT_DESKTOP"));
i += 1;
}
int main() {
uname(&u);
sysinfo(&sys);
order();
printf("\n");
int j = 0;
for(; j < ROWS && j < i; j++) {
printf(COLOR "%s " CLOSE , logo[j]);