From 6a98565d052608ea4f0d174d45497f5a4ffb63d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Tue, 18 Jun 2024 15:59:14 +0900 Subject: =?UTF-8?q?paleofetch=E3=81=8B=E3=82=89=E3=83=AD=E3=82=B4=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 48cb356..01ccfc8 100644 --- a/main.c +++ b/main.c @@ -19,8 +19,13 @@ const char *sofname = "farfetch"; const char *version = "0.0.1"; int main() { + int lc = 0; #if defined(__OpenBSD__) #include "src/logo/openbsd.h" +#elif defined(__NetBSD__) +#include "src/logo/netbsd.h" +#elif defined(__FreeBSD__) +#include "src/logo/freebsd.h" #else #define COLOR "\e[1;30m" #define RESET "\e[0m" @@ -39,7 +44,7 @@ int main() { }; #endif - printf("%s ", LOGO[0]); + printf("%s ", LOGO[lc]); printf(COLOR); display_user_name(); printf(RESET); @@ -47,10 +52,12 @@ int main() { printf(COLOR); display_user_host(); printf(RESET); - printf("%s ", LOGO[1]); + lc++; + printf("%s ", LOGO[lc]); printf("------------------\n"); + lc++; - printf("%s ", LOGO[2]); + printf("%s ", LOGO[lc]); printf(COLOR"%s%s"RESET, "OS", ": "); display_os_name(); printf(" "); @@ -58,19 +65,23 @@ int main() { printf(" "); display_os_arch(); printf("\n"); + lc++; #if defined(__linux__) + printf("%s ", LOGO[lc]); printf(COLOR"%s%s"RESET, "Distro", ": "); display_distro(); printf("\n"); + lc++; #endif - printf("%s ", LOGO[3]); + printf("%s ", LOGO[lc]); printf(COLOR"%s%s"RESET, "Host", ": "); display_host_model(); printf("\n"); + lc++; - printf("%s ", LOGO[4]); + printf("%s ", LOGO[lc]); printf(COLOR"%s%s"RESET, "Uptime", ": "); #ifndef __NetBSD__ display_days(); @@ -78,28 +89,32 @@ int main() { #endif display_time(); printf("\n"); + lc++; #if defined(__OpenBSD__) - printf("%s ", LOGO[5]); + printf("%s ", LOGO[lc]); printf(COLOR"%s%s"RESET, "Recording", ": "); printf("audio = "); display_recording_audio(); printf(", video = "); display_recording_video(); printf("\n"); + lc++; #endif - printf("%s ", LOGO[6]); + printf("%s ", LOGO[lc]); printf(COLOR"%s%s"RESET, "CPU", ": "); display_cpu(); printf("\n"); + lc++; - printf("%s ", LOGO[7]); + printf("%s ", LOGO[lc]); printf(COLOR"%s%s"RESET, "Memory", ": "); display_memory(); printf("\n"); + lc++; - for (size_t i = 8; i < sizeof(LOGO) / sizeof(LOGO[0]); i++) { + for (size_t i = lc; i < sizeof(LOGO) / sizeof(LOGO[0]); i++) { printf("%s\n", LOGO[i]); } -- cgit v1.2.3