paleofetch

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit adb4ae031484c5eee4ed166ad0f6a6c4ce86149f
parent d3791887b14e4be265097cc32673ee91ca310b37
Author: sam-barr <samfbarr@outlook.com>
Date:   Wed, 22 Apr 2020 22:14:08 -0500

added config.h

Diffstat:
MMakefile | 2+-
Aconfig.h | 26++++++++++++++++++++++++++
Mlogos/arch.h | 38+++++++++++++++++++-------------------
Mlogos/arch2.h | 36++++++++++++++++++------------------
Mpaleofetch.c | 26+++-----------------------
5 files changed, 67 insertions(+), 61 deletions(-)

diff --git a/Makefile b/Makefile @@ -6,7 +6,7 @@ all: paleofetch clean: rm -f fetch -paleofetch: paleofetch.c +paleofetch: paleofetch.c paleofetch.h config.h $(CC) paleofetch.c -o paleofetch $(CFLAGS) strip paleofetch diff --git a/config.h b/config.h @@ -0,0 +1,26 @@ +#include "logos/arch.h" +#define DISTRO "Arch" +#define COLOR "\e[1;36m" + +#define CONFIG \ +{ \ + /* name function cached */\ + { "", get_title, false }, \ + { "", get_bar, false }, \ + { "OS: ", get_os, true }, \ + { "Host: ", get_host, true }, \ + { "Kernel: ", get_kernel, true }, \ + { "Uptime: ", get_uptime, false }, \ + { "", spacer, false }, \ + { "Packages: ", get_packages, false }, \ + { "Shell: ", get_shell, false }, \ + { "Resolution: ", get_resolution, false }, \ + { "Terminal: ", get_terminal, false }, \ + { "", spacer, false }, \ + { "CPU: ", get_cpu, true }, \ + { "GPU: ", get_gpu, true }, \ + { "Memory: ", get_memory, false }, \ + { "", spacer, false }, \ + { "", get_colors1, false }, \ + { "", get_colors2, false }, \ +}; diff --git a/logos/arch.h b/logos/arch.h @@ -1,22 +1,22 @@ // This was stolen from neofetch char *LOGO[] = { - "\e[1;36m -` ", - "\e[1;36m .o+` ", - "\e[1;36m `ooo/ ", - "\e[1;36m `+oooo: ", - "\e[1;36m `+oooooo: ", - "\e[1;36m -+oooooo+: ", - "\e[1;36m `/:-:++oooo+: ", - "\e[1;36m `/++++/+++++++: ", - "\e[1;36m `/++++++++++++++: ", - "\e[1;36m `/+++ooooooooooooo/` ", - "\e[1;36m ./ooosssso++osssssso+` ", - "\e[1;36m .oossssso-````/ossssss+` ", - "\e[1;36m -osssssso. :ssssssso. ", - "\e[1;36m :osssssss/ osssso+++. ", - "\e[1;36m /ossssssss/ +ssssooo/- ", - "\e[1;36m `/ossssso+/:- -:/+osssso+- ", - "\e[1;36m `+sso+:-` `.-/+oso: ", - "\e[1;36m`++:. `-/+/ ", - "\e[1;36m.` `/ " + " -` ", + " .o+` ", + " `ooo/ ", + " `+oooo: ", + " `+oooooo: ", + " -+oooooo+: ", + " `/:-:++oooo+: ", + " `/++++/+++++++: ", + " `/++++++++++++++: ", + " `/+++ooooooooooooo/` ", + " ./ooosssso++osssssso+` ", + " .oossssso-````/ossssss+` ", + " -osssssso. :ssssssso. ", + " :osssssss/ osssso+++. ", + " /ossssssss/ +ssssooo/- ", + " `/ossssso+/:- -:/+osssso+- ", + " `+sso+:-` `.-/+oso: ", + "`++:. `-/+/ ", + ".` `/ " }; diff --git a/logos/arch2.h b/logos/arch2.h @@ -1,21 +1,21 @@ // And this was stolen from archey3 char *LOGO[] = { - "\e[1;36m + ", - "\e[1;36m # ", - "\e[1;36m ### ", - "\e[1;36m ##### ", - "\e[1;36m ###### ", - "\e[1;36m ; #####; ", - "\e[1;36m +##.##### ", - "\e[1;36m +########## ", - "\e[1;36m #############; ", - "\e[1;36m ###############+ ", - "\e[1;36m ####### ####### ", - "\e[1;36m .######; ;###;`'. ", - "\e[1;36m .#######; ;#####. ", - "\e[1;36m #########. .########` ", - "\e[1;36m ######' '###### ", - "\e[1;36m ;#### ####; ", - "\e[1;36m ##' '## ", - "\e[1;36m#' `# " + " + ", + " # ", + " ### ", + " ##### ", + " ###### ", + " ; #####; ", + " +##.##### ", + " +########## ", + " #############; ", + " ###############+ ", + " ####### ####### ", + " .######; ;###;`'. ", + " .#######; ;#####. ", + " #########. .########` ", + " ######' '###### ", + " ;#### ####; ", + " ##' '## ", + "#' `# " }; diff --git a/paleofetch.c b/paleofetch.c @@ -13,34 +13,14 @@ #include <X11/Xatom.h> #include "paleofetch.h" -#include "logos/arch2.h" +#include "config.h" -#define DISTRO "Arch" #define BUF_SIZE 150 struct conf { char *label, *(*function)(); bool cached; -} config[] = { - { "", get_title, false }, - { "", get_bar, false }, - { "OS: ", get_os, true }, - { "Host: ", get_host, true }, - { "Kernel: ", get_kernel, true }, - { "Uptime: ", get_uptime, false }, - { "", spacer, false }, - { "Packages: ", get_packages, false }, - { "Shell: ", get_shell, false }, - { "Resolution: ", get_resolution, false }, - { "Terminal: ", get_terminal, false }, - { "", spacer, false }, - { "CPU: ", get_cpu, true }, - { "GPU: ", get_gpu, true }, - { "Memory: ", get_memory, false }, - { "", spacer, false }, - { "", get_colors1, false }, - { "", get_colors2, false }, -}; +} config[] = CONFIG; Display *display; struct utsname uname_info; @@ -504,7 +484,7 @@ int main(int argc, char *argv[]) { // Otherwise, we've got a bit of work to do. char *label = config[i].label, *value = get_value(config[i], read_cache, cache_data); - printf("\e[1;36m%s%s\e[0m%s\n", LOGO[i], label, value); + printf(COLOR"%s%s\e[0m%s\n", LOGO[i], label, value); free(value); }