From 261b39692f5b0ba5cfad6e7be4c8b40b94852155 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 22:04:27 +0900 Subject: [PATCH] =?UTF-8?q?Linux:=20=E3=83=AD=E3=82=B4=EF=BC=88=EF=BD=92?= =?UTF-8?q?=EF=BD=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- main.c | 5 +- src/logo/alpine.h | 29 ---- src/logo/arch.h | 27 ---- src/logo/artix.h | 28 ---- src/logo/crux.h | 28 ---- src/logo/debian.h | 27 ---- src/logo/devuan.h | 26 --- src/logo/freebsd.h | 5 + src/logo/gentoo.h | 27 ---- src/logo/linux.h | 340 ++++++++++++++++++++++++++++++++++++++++ src/logo/linux_def.c | 75 +++++++++ src/logo/linux_def.h | 6 + src/logo/netbsd.h | 5 + src/logo/openbsd.h | 5 + src/logo/openindiana.h | 5 + src/logo/postmarketos.h | 27 ---- src/logo/void.h | 40 ----- 18 files changed, 446 insertions(+), 261 deletions(-) delete mode 100644 src/logo/alpine.h delete mode 100644 src/logo/arch.h delete mode 100644 src/logo/artix.h delete mode 100644 src/logo/crux.h delete mode 100644 src/logo/debian.h delete mode 100644 src/logo/devuan.h delete mode 100644 src/logo/gentoo.h create mode 100644 src/logo/linux_def.c create mode 100644 src/logo/linux_def.h delete mode 100644 src/logo/postmarketos.h delete mode 100644 src/logo/void.h diff --git a/Makefile b/Makefile index f2025be..664feb5 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ MANPREFIX = ${PREFIX}/man .endif CC = cc -FILES = main.c src/*.c +FILES = main.c src/*.c src/logo/*.c CFLAGS = -Wall -Wextra -O3 -I${PREFIX}/include -L${PREFIX}/lib .if ${UNAME_S} == "NetBSD" CFLAGS += -I/usr/pkg/include -L/usr/pkg/lib -I/usr/include -L/usr/lib diff --git a/main.c b/main.c index 9db02d8..389acde 100644 --- a/main.c +++ b/main.c @@ -1,11 +1,11 @@ #include -#include #include #include "src/user.h" #include "src/os.h" #if defined(__linux__) #include "src/distro.h" +#include "src/logo/linux_def.h" #endif #include "src/host.h" #include "src/uptime.h" @@ -32,6 +32,9 @@ int main(int argc, char *argv[]) { #include "src/logo/netbsd.h" #elif defined(__FreeBSD__) #include "src/logo/freebsd.h" +#elif defined(__linux__) + getDistro(distroname); +#include "src/logo/linux.h" #else #define COLOR "\e[1;30m" #define RESET "\e[0m" diff --git a/src/logo/alpine.h b/src/logo/alpine.h deleted file mode 100644 index a291c30..0000000 --- a/src/logo/alpine.h +++ /dev/null @@ -1,29 +0,0 @@ -#define BLUE "\e[1;34m" -#define MAGENTA "\e[1;35m" -#define RESET "\e[0m" - -#define COLOR MAGENTA -#define TITLECOLOR BLUE - -char *LOGO[] = { -BLUE " .hddddddddddddddddddddddh. ", -" :dddddddddddddddddddddddddd: ", -" /dddddddddddddddddddddddddddd/ ", -" +dddddddddddddddddddddddddddddd+ ", -" `sdddddddddddddddddddddddddddddddds` ", -" `ydddddddddddd++hdddddddddddddddddddy` ", -".hddddddddddd+` `+ddddh:-sdddddddddddh. ", -"hdddddddddd+` `+y: .sddddddddddh ", -"ddddddddh+` `//` `.` -sddddddddd ", -"ddddddh+` `/hddh/` `:s- -sddddddd ", -"ddddh+` `/+/dddddh/` `+s- -sddddd ", -"ddd+` `/o` :dddddddh/` `oy- .yddd ", -"hdddyo+ohddyosdddddddddho+oydddy++ohdddh ", -".hddddddddddddddddddddddddddddddddddddh. ", -" `yddddddddddddddddddddddddddddddddddy` ", -" `sdddddddddddddddddddddddddddddddds` ", -" +dddddddddddddddddddddddddddddd+ ", -" /dddddddddddddddddddddddddddd/ ", -" :dddddddddddddddddddddddddd: ", -" .hddddddddddddddddddddddh. " RESET -}; diff --git a/src/logo/arch.h b/src/logo/arch.h deleted file mode 100644 index 8baf53e..0000000 --- a/src/logo/arch.h +++ /dev/null @@ -1,27 +0,0 @@ -#define CYAN "\e[1;36m" -#define RESET "\e[0m" - -#define COLOR CYAN -#define TITLECOLOR CYAN - -char *LOGO[] = { -CYAN " -` " RESET, -CYAN " .o+` " RESET, -CYAN " `ooo/ " RESET, -CYAN " `+oooo: " RESET, -CYAN " `+oooooo: " RESET, -CYAN " -+oooooo+: " RESET, -CYAN " `/:-:++oooo+: " RESET, -CYAN " `/++++/+++++++: " RESET, -CYAN " `/++++++++++++++: " RESET, -CYAN " `/+++ooooooooooooo/` " RESET, -CYAN " ./ooosssso++osssssso+` " RESET, -CYAN " .oossssso-````/ossssss+` " RESET, -CYAN " -osssssso. :ssssssso. " RESET, -CYAN " :osssssss/ osssso+++. " RESET, -CYAN " /ossssssss/ +ssssooo/- " RESET, -CYAN " `/ossssso+/:- -:/+osssso+- " RESET, -CYAN " `+sso+:-` `.-/+oso: " RESET, -CYAN "`++:. `-/+/ " RESET, -CYAN ".` `/ " RESET -}; diff --git a/src/logo/artix.h b/src/logo/artix.h deleted file mode 100644 index ac8dcee..0000000 --- a/src/logo/artix.h +++ /dev/null @@ -1,28 +0,0 @@ -#define CYAN "\e[1;36m" -#define RESET "\e[0m" - -#define COLOR CYAN -#define TITLECOLOR CYAN - -char *LOGO[] = { -CYAN " ' " RESET, -CYAN " 'o' " RESET, -CYAN " 'ooo' " RESET, -CYAN " 'ooxoo' " RESET, -CYAN " 'ooxxxoo' " RESET, -CYAN " 'oookkxxoo' " RESET, -CYAN " 'oiioxkkxxoo' " RESET, -CYAN " ':;:iiiioxxxoo' " RESET, -CYAN " `'.;::ioxxoo' " RESET, -CYAN " '-. `':;jiooo' " RESET, -CYAN " 'oooio-.. `'i:io' " RESET, -CYAN " 'ooooxxxxoio:,. `'-;' " RESET, -CYAN " 'ooooxxxxxkkxoooIi:-. `' " RESET, -CYAN " 'ooooxxxxxkkkkxoiiiiiji' " RESET, -CYAN " 'ooooxxxxxkxxoiiii:'` .i' " RESET, -CYAN " 'ooooxxxxxoi:::'` .;ioxo' " RESET, -CYAN " 'ooooxooi::'` .:iiixkxxo' " RESET, -CYAN " 'ooooi:'` `'';ioxxo' " RESET, -CYAN " 'i:'` '':io' " RESET, -CYAN "'` `' " RESET -}; diff --git a/src/logo/crux.h b/src/logo/crux.h deleted file mode 100644 index 0e764b5..0000000 --- a/src/logo/crux.h +++ /dev/null @@ -1,28 +0,0 @@ -#define BLUE "\e[1;34m" -#define MAGENTA "\e[1;35m" -#define WHITE "\e[1;37m" -#define RESET "\e[0m" - -#define COLOR MAGENTA -#define TITLECOLOR BLUE - -char *LOGO[] = { -BLUE " odddd " RESET, -BLUE " oddxkkkxxdoo " RESET, -BLUE " ddcoddxxxdoool " RESET, -BLUE " xdclodod olol " RESET, -BLUE " xoc xdd olol " RESET, -BLUE " xdc " MAGENTA "k00" BLUE "Okdlol " RESET, -BLUE " xxd" MAGENTA "kOKKKOkd" BLUE "ldd " RESET, -BLUE " xdco" MAGENTA "xOkdlo" BLUE "dldd " RESET, -BLUE " ddc:cl" MAGENTA "lll" BLUE "oooodo " RESET, -BLUE " odxxdd" WHITE "xkO000kx" BLUE "ooxdo " RESET, -BLUE " oxdd" WHITE "x0NMMMMMMWW0od" BLUE "kkxo " RESET, -BLUE " oooxd" WHITE "0WMMMMMMMMMW0o" BLUE "dxkx " RESET, -BLUE "docldkXW" WHITE "MMMMMMMWWN" BLUE "Odolco " RESET, -BLUE "xx" MAGENTA "dx" BLUE "kxxOKN" WHITE "WMMWN" BLUE "0xdoxo::c " RESET, -MAGENTA "xOkkO" BLUE "0oo" WHITE "odOW" MAGENTA "WW" BLUE "XkdodOxc:l " RESET, -MAGENTA "dkkkxkkk" WHITE "OKX" MAGENTA "NNNX0Oxx" BLUE "xc:cd " RESET, -MAGENTA " odxxdx" WHITE "xllod" MAGENTA "ddooxx" BLUE "dc:ldo " RESET, -MAGENTA " lodd" BLUE "dolccc" MAGENTA "ccox" BLUE "xoloo " RESET -}; diff --git a/src/logo/debian.h b/src/logo/debian.h deleted file mode 100644 index d47882e..0000000 --- a/src/logo/debian.h +++ /dev/null @@ -1,27 +0,0 @@ -#define RED "\e[1;31m" -#define WHITE "\e[1;37m" -#define RESET "\e[0m" - -#define COLOR RED -#define TITLECOLOR RED - -char *LOGO[] = { -WHITE " _,met$$$$$gg. " RESET, -WHITE " ,g$$$$$$$$$$$$$$$P. " RESET, -WHITE " ,g$$P\" \"\"\"Y$$.\". " RESET, -WHITE " ,$$P' `$$$. " RESET, -WHITE "',$$P ,ggs. `$$b: " RESET, -WHITE "`d$$' ,$P\"' " RED "." WHITE " $$$ " RESET, -WHITE " $$P d$' " RED "," WHITE " $$P " RESET, -WHITE " $$: $$. - ,d$$' " RESET, -WHITE " $$; Y$b._ _,d$P' " RESET, -WHITE " Y$$. " RED "`." WHITE "`\"Y$$$$P\"' " RESET, -WHITE " `$$b " RED "\"-.__" WHITE " " RESET, -WHITE " `Y$$ " RESET, -WHITE " `Y$$. " RESET, -WHITE " `$$b. " RESET, -WHITE " `Y$$b. " RESET, -WHITE " `\"Y$b._ " RESET, -WHITE " `\"\"\" " RESET, -WHITE " " RESET -}; diff --git a/src/logo/devuan.h b/src/logo/devuan.h deleted file mode 100644 index ff98869..0000000 --- a/src/logo/devuan.h +++ /dev/null @@ -1,26 +0,0 @@ -#define MAGENTA "\e[1;35m" -#define RESET "\e[0m" - -#define COLOR MAGENTA -#define TITLECOLOR MAGENTA - -char *LOGO[] = { -MAGENTA " ..,,;;;::;,.. " RESET, -MAGENTA " `':ddd;:,. " RESET, -MAGENTA " `'dPPd:,. " RESET, -MAGENTA " `:b$$b`. " RESET, -MAGENTA " 'P$$$d` " RESET, -MAGENTA " .$$$$$` " RESET, -MAGENTA " ;$$$$$P " RESET, -MAGENTA " .:P$$$$$$` " RESET, -MAGENTA " .,:b$$$$$$$;' " RESET, -MAGENTA " .,:dP$$$$$$$$b:' " RESET, -MAGENTA " .,:;db$$$$$$$$$$Pd'` " RESET, -MAGENTA " ,db$$$$$$$$$$$$$$b:'` " RESET, -MAGENTA ":$$$$$$$$$$$$b:'` " RESET, -MAGENTA " `$$$$$bd:''` " RESET, -MAGENTA " `'''` " RESET, -MAGENTA " " RESET, -MAGENTA " " RESET, -MAGENTA " " RESET -}; diff --git a/src/logo/freebsd.h b/src/logo/freebsd.h index 12db9d3..ae154d1 100644 --- a/src/logo/freebsd.h +++ b/src/logo/freebsd.h @@ -1,3 +1,6 @@ +#ifndef LOGO_FREEBSD_H +#define LOGO_FREEBSD_H + #define RED "\e[1;31m" #define WHITE "\e[1;37m" #define RESET "\e[0m" @@ -34,3 +37,5 @@ RED "| | " RESET, RED " ; ; " RESET, RED " '-_____-' " RESET }; + +#endif diff --git a/src/logo/gentoo.h b/src/logo/gentoo.h deleted file mode 100644 index 5c762b7..0000000 --- a/src/logo/gentoo.h +++ /dev/null @@ -1,27 +0,0 @@ -#define MAGENTA "\e[1;35m" -#define WHITE "\e[1;37m" -#define RESET "\e[0m" - -#define COLOR MAGENTA -#define TITLECOLOR MAGENTA - -char *LOGO[] = { -MAGENTA " -/oyddmdhs+:. " RESET, -MAGENTA " -o" WHITE "dNMMMMMMMMNNmhy+" MAGENTA "-` " RESET, -MAGENTA " -y" WHITE "NMMMMMMMMMMMNNNmmdhy" MAGENTA "+- " RESET, -MAGENTA " `o" WHITE "mMMMMMMMMMMMMNmdmmmmddhhy" MAGENTA "/` " RESET, -MAGENTA " om" WHITE "MMMMMMMMMMMN" MAGENTA "hhyyyo" WHITE "hmdddhhhd" MAGENTA "o` " RESET, -MAGENTA ".y" WHITE "dMMMMMMMMMMd" MAGENTA "hs++so/s" WHITE "mdddhhhhdm" MAGENTA "+` " RESET, -MAGENTA " oy" WHITE "hdmNMMMMMMMN" MAGENTA "dyooy" WHITE "dmddddhhhhyhN" MAGENTA "d. " RESET, -MAGENTA " :o" WHITE "yhhdNNMMMMMMMNNNmmdddhhhhhyym" MAGENTA "Mh " RESET, -MAGENTA " .:" WHITE "+sydNMMMMMNNNmmmdddhhhhhhmM" MAGENTA "my " RESET, -MAGENTA " /m" WHITE "MMMMMMNNNmmmdddhhhhhmMNh" MAGENTA "s: " RESET, -MAGENTA " `o" WHITE "NMMMMMMMNNNmmmddddhhdmMNhs" MAGENTA "+` " RESET, -MAGENTA " `s" WHITE "NMMMMMMMMNNNmmmdddddmNMmhs" MAGENTA "/. " RESET, -MAGENTA " /N" WHITE "MMMMMMMMNNNNmmmdddmNMNdso" MAGENTA ":` " RESET, -MAGENTA "+M" WHITE "MMMMMMNNNNNmmmmdmNMNdso" MAGENTA "/- " RESET, -MAGENTA "yM" WHITE "MNNNNNNNmmmmmNNMmhs+/" MAGENTA" -` " RESET, -MAGENTA "/h" WHITE "MMNNNNNNNNMNdhs++/" MAGENTA "-` " RESET, -MAGENTA "`/" WHITE "ohdmmddhys+++/:" MAGENTA ".` " RESET, -MAGENTA " `-//////:--. " RESET -}; diff --git a/src/logo/linux.h b/src/logo/linux.h index 21065cd..6f4ba99 100644 --- a/src/logo/linux.h +++ b/src/logo/linux.h @@ -1,11 +1,40 @@ +#ifndef LOGO_LINUX_H +#define LOGO_LINUX_H + +#include "../distro.h" + #define GREY "\e[1;30m" +#define RED "\e[1;31m" +#define GREEN "\e[1;32m" #define YELLOW "\e[1;33m" +#define BLUE "\e[1;34m" +#define MAGENTA "\e[1;35m" +#define CYAN "\e[1;36m" #define WHITE "\e[1;37m" #define RESET "\e[0m" #define COLOR WHITE #define TITLECOLOR WHITE +#define DISTRO_LINUX 0 +#define DISTRO_ALPINE 1 +#define DISTRO_ARCH 2 +#define DISTRO_ARTIX 3 +#define DISTRO_CRUX 4 +#define DISTRO_DEBIAN 5 +#define DISTRO_DEVUAN 6 +#define DISTRO_GENTOO 7 +#define DISTRO_POSTMARKETOS 8 +#define DISTRO_VOID 9 + +#ifndef DISTRO +#define DISTRO DISTRO_LINUX +#endif + +#define COLOR WHITE +#define TITLECOLOR WHITE + +#if DISTRO == DISTRO_LINUX char *LOGO[] = { GREY " ##### " RESET, GREY " ####### " RESET, @@ -26,3 +55,314 @@ GREY " " RESET, GREY " " RESET, GREY " " RESET }; + +char *LOGO_SMALL[] = { +GREY " ___ " RESET, +GREY " / \\ " RESET, +GREY " |" WHITE "0 0" GREY "| " RESET, +GREY " | " YELLOW "v" GREY " | " RESET, +GREY " / " WHITE "/ \\" GREY " \\ " RESET, +GREY " | " WHITE "\\_/" GREY " | " RESET, +YELLOW "/ " GREY "_____" YELLOW " \\ " RESET, +YELLOW "\\/ \\/ " RESET +}; +#elif DISTRO == DISTRO_ALPINE +// Alpine +char *LOGO[] = { +BLUE " .hddddddddddddddddddddddh. " RESET, +BLUE " :dddddddddddddddddddddddddd: " RESET, +BLUE " /dddddddddddddddddddddddddddd/ " RESET, +BLUE " +dddddddddddddddddddddddddddddd+ " RESET, +BLUE " `sdddddddddddddddddddddddddddddddds` " RESET, +BLUE " `ydddddddddddd++hdddddddddddddddddddy` " RESET, +BLUE ".hddddddddddd+` `+ddddh:-sdddddddddddh. " RESET, +BLUE "hdddddddddd+` `+y: .sddddddddddh " RESET, +BLUE "ddddddddh+` `//` `.` -sddddddddd " RESET, +BLUE "ddddddh+` `/hddh/` `:s- -sddddddd " RESET, +BLUE "ddddh+` `/+/dddddh/` `+s- -sddddd " RESET, +BLUE "ddd+` `/o` :dddddddh/` `oy- .yddd " RESET, +BLUE "hdddyo+ohddyosdddddddddho+oydddy++ohdddh " RESET, +BLUE ".hddddddddddddddddddddddddddddddddddddh. " RESET, +BLUE " `yddddddddddddddddddddddddddddddddddy` " RESET, +BLUE " `sdddddddddddddddddddddddddddddddds` " RESET, +BLUE " +dddddddddddddddddddddddddddddd+ " RESET, +BLUE " /dddddddddddddddddddddddddddd/ " RESET, +BLUE " :dddddddddddddddddddddddddd: " RESET, +BLUE " .hddddddddddddddddddddddh. " RESET +}; + +char *LOGO_SMALL[] = { +BLUE " /\\ /\\ " RESET, +BLUE " /" WHITE "/ " BLUE "\\ \\ " RESET, +BLUE " /" WHITE "/ " BLUE "\\ \\ " RESET, +BLUE "/" WHITE "// " BLUE "\\ \\ " RESET, +WHITE "// " BLUE "\\ \\ " RESET, +BLUE " \\ " RESET +}; +#elif DISTRO == DISTRO_ARCH +// Arch +char *LOGO[] = { +CYAN " -` " RESET, +CYAN " .o+` " RESET, +CYAN " `ooo/ " RESET, +CYAN " `+oooo: " RESET, +CYAN " `+oooooo: " RESET, +CYAN " -+oooooo+: " RESET, +CYAN " `/:-:++oooo+: " RESET, +CYAN " `/++++/+++++++: " RESET, +CYAN " `/++++++++++++++: " RESET, +CYAN " `/+++ooooooooooooo/` " RESET, +CYAN " ./ooosssso++osssssso+` " RESET, +CYAN " .oossssso-````/ossssss+` " RESET, +CYAN " -osssssso. :ssssssso. " RESET, +CYAN " :osssssss/ osssso+++. " RESET, +CYAN " /ossssssss/ +ssssooo/- " RESET, +CYAN " `/ossssso+/:- -:/+osssso+- " RESET, +CYAN " `+sso+:-` `.-/+oso: " RESET, +CYAN "`++:. `-/+/ " RESET, +CYAN ".` `/ " RESET +}; + +char *LOGO_SMALL[] = { +CYAN " /\\ " RESET, +CYAN " / \\ " RESET, +CYAN " /\\ \\ " RESET, +WHITE " / \\ " RESET, +WHITE " / ,, \\ " RESET, +WHITE " / | | -\\ " RESET, +WHITE "/_-'' ''-_\\ " RESET +}; + +#elif DISTRO == DISTRO_ARTIX +// Artix +char *LOGO[] = { +CYAN " ' " RESET, +CYAN " 'o' " RESET, +CYAN " 'ooo' " RESET, +CYAN " 'ooxoo' " RESET, +CYAN " 'ooxxxoo' " RESET, +CYAN " 'oookkxxoo' " RESET, +CYAN " 'oiioxkkxxoo' " RESET, +CYAN " ':;:iiiioxxxoo' " RESET, +CYAN " `'.;::ioxxoo' " RESET, +CYAN " '-. `':;jiooo' " RESET, +CYAN " 'oooio-.. `'i:io' " RESET, +CYAN " 'ooooxxxxoio:,. `'-;' " RESET, +CYAN " 'ooooxxxxxkkxoooIi:-. `' " RESET, +CYAN " 'ooooxxxxxkkkkxoiiiiiji' " RESET, +CYAN " 'ooooxxxxxkxxoiiii:'` .i' " RESET, +CYAN " 'ooooxxxxxoi:::'` .;ioxo' " RESET, +CYAN " 'ooooxooi::'` .:iiixkxxo' " RESET, +CYAN " 'ooooi:'` `'';ioxxo' " RESET, +CYAN " 'i:'` '':io' " RESET, +CYAN "'` `' " RESET +}; + +char *LOGO_SMALL[] = { +CYAN " /\\ " RESET, +CYAN " / \\ " RESET, +CYAN " /`'.,\\ " RESET, +CYAN " / ', " RESET, +CYAN " / ,`\\ " RESET, +CYAN " / ,.'`. \\ " RESET, +CYAN "/.,'` `'.\\ " RESET +}; + +#elif DISTRO == DISTRO_CRUX +// CRUX +char *LOGO[] = { +BLUE " odddd " RESET, +BLUE " oddxkkkxxdoo " RESET, +BLUE " ddcoddxxxdoool " RESET, +BLUE " xdclodod olol " RESET, +BLUE " xoc xdd olol " RESET, +BLUE " xdc " MAGENTA "k00" BLUE "Okdlol " RESET, +BLUE " xxd" MAGENTA "kOKKKOkd" BLUE "ldd " RESET, +BLUE " xdco" MAGENTA "xOkdlo" BLUE "dldd " RESET, +BLUE " ddc:cl" MAGENTA "lll" BLUE "oooodo " RESET, +BLUE " odxxdd" WHITE "xkO000kx" BLUE "ooxdo " RESET, +BLUE " oxdd" WHITE "x0NMMMMMMWW0od" BLUE "kkxo " RESET, +BLUE " oooxd" WHITE "0WMMMMMMMMMW0o" BLUE "dxkx " RESET, +BLUE "docldkXW" WHITE "MMMMMMMWWN" BLUE "Odolco " RESET, +BLUE "xx" MAGENTA "dx" BLUE "kxxOKN" WHITE "WMMWN" BLUE "0xdoxo::c " RESET, +MAGENTA "xOkkO" BLUE "0oo" WHITE "odOW" MAGENTA "WW" BLUE "XkdodOxc:l " RESET, +MAGENTA "dkkkxkkk" WHITE "OKX" MAGENTA "NNNX0Oxx" BLUE "xc:cd " RESET, +MAGENTA " odxxdx" WHITE "xllod" MAGENTA "ddooxx" BLUE "dc:ldo " RESET, +MAGENTA " lodd" BLUE "dolccc" MAGENTA "ccox" BLUE "xoloo " RESET +}; + +char *LOGO_SMALL[] = { +BLUE " ___ " RESET, +BLUE " (" WHITE ".ยท" BLUE " | " RESET, +BLUE " (" MAGENTA "<>" BLUE " | " RESET, +BLUE " / " WHITE "__" BLUE " \\ " RESET, +BLUE " ( " WHITE "/ \\" BLUE " /| " RESET, +MAGENTA "_" BLUE "/\\ "WHITE "__)" BLUE "/" MAGENTA "_" BLUE ") " RESET, +MAGENTA "\\/" BLUE "-____" MAGENTA "\\/ " RESET +}; + +#elif DISTRO == DISTRO_DEBIAN +// Debian +char *LOGO[] = { +WHITE " _,met$$$$$gg. " RESET, +WHITE " ,g$$$$$$$$$$$$$$$P. " RESET, +WHITE " ,g$$P\" \"\"\"Y$$.\". " RESET, +WHITE " ,$$P' `$$$. " RESET, +WHITE "',$$P ,ggs. `$$b: " RESET, +WHITE "`d$$' ,$P\"' " RED "." WHITE " $$$ " RESET, +WHITE " $$P d$' " RED "," WHITE " $$P " RESET, +WHITE " $$: $$. - ,d$$' " RESET, +WHITE " $$; Y$b._ _,d$P' " RESET, +WHITE " Y$$. " RED "`." WHITE "`\"Y$$$$P\"' " RESET, +WHITE " `$$b " RED "\"-.__" WHITE " " RESET, +WHITE " `Y$$ " RESET, +WHITE " `Y$$. " RESET, +WHITE " `$$b. " RESET, +WHITE " `Y$$b. " RESET, +WHITE " `\"Y$b._ " RESET, +WHITE " `\"\"\" " RESET, +WHITE " " RESET +}; + +char *LOGO_SMALL[] = { +RED " _____ " RESET, +RED " / __ \\ " RESET, +RED "| / | " RESET, +RED "| \\___- " RESET, +RED "-_ " RESET, +RED " --_ " RESET +}; + +#elif DISTRO == DISTRO_DEVUAN +// Devuan +char *LOGO[] = { +MAGENTA " ..,,;;;::;,.. " RESET, +MAGENTA " `':ddd;:,. " RESET, +MAGENTA " `'dPPd:,. " RESET, +MAGENTA " `:b$$b`. " RESET, +MAGENTA " 'P$$$d` " RESET, +MAGENTA " .$$$$$` " RESET, +MAGENTA " ;$$$$$P " RESET, +MAGENTA " .:P$$$$$$` " RESET, +MAGENTA " .,:b$$$$$$$;' " RESET, +MAGENTA " .,:dP$$$$$$$$b:' " RESET, +MAGENTA " .,:;db$$$$$$$$$$Pd'` " RESET, +MAGENTA " ,db$$$$$$$$$$$$$$b:'` " RESET, +MAGENTA ":$$$$$$$$$$$$b:'` " RESET, +MAGENTA " `$$$$$bd:''` " RESET, +MAGENTA " `'''` " RESET, +MAGENTA " " RESET, +MAGENTA " " RESET, +MAGENTA " " RESET +}; + +char *LOGO_SMALL[] = { +MAGENTA "__ " RESET, +MAGENTA " \\ " RESET, +MAGENTA " _/ " RESET +}; + +#elif DISTRO == DISTRO_GENTOO +// Gentoo +char *LOGO[] = { +MAGENTA " -/oyddmdhs+:. " RESET, +MAGENTA " -o" WHITE "dNMMMMMMMMNNmhy+" MAGENTA "-` " RESET, +MAGENTA " -y" WHITE "NMMMMMMMMMMMNNNmmdhy" MAGENTA "+- " RESET, +MAGENTA " `o" WHITE "mMMMMMMMMMMMMNmdmmmmddhhy" MAGENTA "/` " RESET, +MAGENTA " om" WHITE "MMMMMMMMMMMN" MAGENTA "hhyyyo" WHITE "hmdddhhhd" MAGENTA "o` " RESET, +MAGENTA ".y" WHITE "dMMMMMMMMMMd" MAGENTA "hs++so/s" WHITE "mdddhhhhdm" MAGENTA "+` " RESET, +MAGENTA " oy" WHITE "hdmNMMMMMMMN" MAGENTA "dyooy" WHITE "dmddddhhhhyhN" MAGENTA "d. " RESET, +MAGENTA " :o" WHITE "yhhdNNMMMMMMMNNNmmdddhhhhhyym" MAGENTA "Mh " RESET, +MAGENTA " .:" WHITE "+sydNMMMMMNNNmmmdddhhhhhhmM" MAGENTA "my " RESET, +MAGENTA " /m" WHITE "MMMMMMNNNmmmdddhhhhhmMNh" MAGENTA "s: " RESET, +MAGENTA " `o" WHITE "NMMMMMMMNNNmmmddddhhdmMNhs" MAGENTA "+` " RESET, +MAGENTA " `s" WHITE "NMMMMMMMMNNNmmmdddddmNMmhs" MAGENTA "/. " RESET, +MAGENTA " /N" WHITE "MMMMMMMMNNNNmmmdddmNMNdso" MAGENTA ":` " RESET, +MAGENTA "+M" WHITE "MMMMMMNNNNNmmmmdmNMNdso" MAGENTA "/- " RESET, +MAGENTA "yM" WHITE "MNNNNNNNmmmmmNNMmhs+/" MAGENTA" -` " RESET, +MAGENTA "/h" WHITE "MMNNNNNNNNMNdhs++/" MAGENTA "-` " RESET, +MAGENTA "`/" WHITE "ohdmmddhys+++/:" MAGENTA ".` " RESET, +MAGENTA " `-//////:--. " RESET +}; + +char *LOGO_SMALL[] = { +MAGENTA " _-----_ " RESET, +MAGENTA "( \\ " RESET, +MAGENTA "\\ 0 \\ " RESET, +WHITE " \\ ) " RESET, +WHITE " / _/ " RESET, +WHITE "( _- " RESET, +WHITE "\\____- " RESET +}; + +#elif DISTRO == DISTRO_POSTMARKETOS +// postmarketOS +char *LOGO[] = { +GREEN " /\\ " RESET, +GREEN " / \\ " RESET, +GREEN " / \\ " RESET, +GREEN " / \\ " RESET, +GREEN " / \\ " RESET, +GREEN " / \\ " RESET, +GREEN " \\ \\ " RESET, +GREEN " /\\ \\____ \\ " RESET, +GREEN " / \\____ \\ \\ " RESET, +GREEN " / / \\ \\ " RESET, +GREEN " / / \\ ___\\ " RESET, +GREEN " / / \\ / ____ " RESET, +GREEN " / / \\/ / \\ " RESET, +GREEN " / / __________/ \\ " RESET, +GREEN " / \\ \\ \\ " RESET, +GREEN " / \\ \\ \\ " RESET, +GREEN " / / / \\ " RESET, +GREEN "/___________/ /____________________\\ " RESET, +GREEN " " RESET +}; + +char *LOGO_SMALL[] = { +GREEN " /\\ " RESET, +GREEN " / \\ " RESET, +GREEN " / \\ " RESET, +GREEN " \\__ \\ " RESET, +GREEN " /\\__ \\ _\\ " RESET, +GREEN " / / \\/ __ " RESET, +GREEN " / / ____/ \\ " RESET, +GREEN " / \\ \\ \\ " RESET, +GREEN "/_____/ /________\\ " RESET +}; +#elif DISTRO == DISTRO_VOID +// Void +char *LOGO[] = { +GREEN " __.;=====;.__ " RESET, +GREEN " _.=+==++=++=+=+===;. " RESET, +GREEN " -=+++=+===+=+=+++++=_ " RESET, +GREEN " . -=:`` `--==+=++==. " RESET, +GREEN " _vi, ` --+=++++: " RESET, +GREEN " .uvnvi. _._ -==+==+. " RESET, +GREEN " .vvnvnI` .;==|==;. :|=||=|. " RESET, +GREY "+QmQQm" GREEN "pvvnv; " GREY "_yYsyQQWUUQQQm #QmQ#" GREEN ":" GREY "QQQWUV$QQm. " RESET, +GREY " -QQWQW" GREEN "pvvo" GREY "wZ?.wQQQE" GREEN "==<" GREY "!QWWQ/QWQW.QQWW" GREEN "(: " GREY "jQWQE " RESET, +GREY " -$QQQQmmU' jQQQ@" GREEN "+=<" GREY "QWQQ)mQQQ.mQQQC" GREEN "+;" GREY "jWQQ@' " RESET, +GREY " -$WQ8Y" GREEN "nI: " GREY "QWQQwgQQWV" GREEN"`" GREY "mWQQ.jQWQQgyyWW@! " RESET, +GREEN " -1vvnvv. `~+++` ++|+++ " RESET, +GREEN " +vnvnnv, `-|=== " RESET, +GREEN " +vnvnvns. . :=- " RESET, +GREEN " -Invnvvnsi..___..=sv=. ` " RESET, +GREEN " +Invnvnvnnnnnnnnvvnn;. " RESET, +GREEN " ~|Invnvnvvnvvvnnv}+` " RESET, +GREEN " -~|{*l}*|~ " RESET, +GREEN " " RESET, +GREEN " " RESET +}; + +char *LOGO_SMALL[] = { +GREEN " _______ " RESET, +GREEN " _ \\______ - " RESET, +GREEN "| \\ ___ \\ | " RESET, +GREEN "| | / \\ | | " RESET, +GREEN "| | \\___/ | | " RESET, +GREEN "| \\______ \\_| " RESET, +GREEN " -_______\\ " RESET +}; +#endif +#endif diff --git a/src/logo/linux_def.c b/src/logo/linux_def.c new file mode 100644 index 0000000..12a9ef2 --- /dev/null +++ b/src/logo/linux_def.c @@ -0,0 +1,75 @@ +#include "linux_def.h" + +#include + +void getDistro(const char *distroname) { + if (strncmp((char *)distroname, "alpine", strlen("alpine")) == 0) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_ALPINE +#define COLOR MAGENTA +#define TITLECOLOR BLUE + } else if (strncmp((char *)distroname, "artix", strlen("artix")) == 0) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_ARCH +#define COLOR CYAN +#define TITLECOLOR CYAN + } else if (strncmp((char *)distroname, "arch", strlen("arch")) == 0) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_ARTIX +#define COLOR CYAN +#define TITLECOLOR CYAN + } else if (strncmp((char *)distroname, "crux", strlen("crux")) == 0) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_CRUX +#define COLOR MAGENTA +#define TITLECOLOR BLUE + } else if (strncmp((char *)distroname, "debian", strlen("debian")) == 0) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_DEBIAN +#define COLOR RED +#define TITLECOLOR RED + } else if (strncmp((char *)distroname, "devuan", strlen("devuan")) == 0) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_DEVUAN +#define COLOR MAGENTA +#define TITLECOLOR MAGENTA + } else if (strncmp((char *)distroname, "gentoo", strlen("gentoo")) == 0) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_GENTOO +#define COLOR MAGENTA +#define TITLECOLOR MAGENTA + } else if ( + strncmp((char *)distroname, + "postmarketos", + strlen("postmarketos") + ) == 0 + ) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_POSTMARKETOS +#define COLOR GREEN +#define TITLECOLOR GREEN + } else if (strncmp((char *)distroname, "void", strlen("void")) == 0) { +#undef DISTRO +#undef COLOR +#undef TITLECOLOR +#define DISTRO DISTRO_VOID +#define COLOR WHITE +#define TITLECOLOR GREEN + } +} diff --git a/src/logo/linux_def.h b/src/logo/linux_def.h new file mode 100644 index 0000000..a798b99 --- /dev/null +++ b/src/logo/linux_def.h @@ -0,0 +1,6 @@ +#ifndef LINUX_DEF_H +#define LINUX_DEF_H + +void getDistro(const char *distroname); + +#endif diff --git a/src/logo/netbsd.h b/src/logo/netbsd.h index 06ce65f..a38045a 100644 --- a/src/logo/netbsd.h +++ b/src/logo/netbsd.h @@ -1,3 +1,6 @@ +#ifndef LOGO_NETBSD_H +#define LOGO_NETBSD_H + #define MAGENTA "\e[1;35m" #define WHITE "\e[1;37m" #define RESET "\e[0m" @@ -35,3 +38,5 @@ char *LOGO_SMALL[] = { " \\\\ " RESET, " \\\\ " RESET }; + +#endif diff --git a/src/logo/openbsd.h b/src/logo/openbsd.h index 4c6c2c5..a5fc627 100644 --- a/src/logo/openbsd.h +++ b/src/logo/openbsd.h @@ -1,3 +1,6 @@ +#ifndef LOGO_OPENBSD_H +#define LOGO_OPENBSD_H + #define GREY "\e[1;30m" #define RED "\e[1;31m" #define YELLOW "\e[1;33m" @@ -46,3 +49,5 @@ YELLOW " " RESET, YELLOW " " RESET, YELLOW " " RESET }; + +#endif diff --git a/src/logo/openindiana.h b/src/logo/openindiana.h index 6e39f15..8cec833 100644 --- a/src/logo/openindiana.h +++ b/src/logo/openindiana.h @@ -1,3 +1,6 @@ +#ifndef LOGO_OPENINDIANA_H +#define LOGO_OPENINDIANA_H + #define BLUE "\e[1;34m" #define WHITE "\e[1;37m" #define RESET "\e[0m" @@ -26,3 +29,5 @@ WHITE " " RESET, WHITE " " RESET, WHITE " " RESET }; + +#endif diff --git a/src/logo/postmarketos.h b/src/logo/postmarketos.h deleted file mode 100644 index d0f3c56..0000000 --- a/src/logo/postmarketos.h +++ /dev/null @@ -1,27 +0,0 @@ -#define GREEN "\e[1;32m" -#define RESET "\e[0m" - -#define COLOR GREEN -#define TITLECOLOR GREEN - -char *LOGO[] = { -GREEN " /\\ " RESET, -GREEN " / \\ " RESET, -GREEN " / \\ " RESET, -GREEN " / \\ " RESET, -GREEN " / \\ " RESET, -GREEN " / \\ " RESET, -GREEN " \\ \\ " RESET, -GREEN " /\\ \\____ \\ " RESET, -GREEN " / \\____ \\ \\ " RESET, -GREEN " / / \\ \\ " RESET, -GREEN " / / \\ ___\\ " RESET, -GREEN " / / \\ / ____ " RESET, -GREEN " / / \\/ / \\ " RESET, -GREEN " / / __________/ \\ " RESET, -GREEN " / \\ \\ \\ " RESET, -GREEN " / \\ \\ \\ " RESET, -GREEN " / / / \\ " RESET, -GREEN "/___________/ /____________________\\ " RESET, -GREEN " " RESET -}; diff --git a/src/logo/void.h b/src/logo/void.h deleted file mode 100644 index ff5f82a..0000000 --- a/src/logo/void.h +++ /dev/null @@ -1,40 +0,0 @@ -#define GREY "\e[1;30m" -#define GREEN "\e[1;32m" -#define WHITE "\e[1;37m" -#define RESET "\e[0m" - -#define COLOR WHITE -#define TITLECOLOR GREEN - -char *LOGO[] = { -GREEN " __.;=====;.__ " RESET, -GREEN " _.=+==++=++=+=+===;. " RESET, -GREEN " -=+++=+===+=+=+++++=_ " RESET, -GREEN " . -=:`` `--==+=++==. " RESET, -GREEN " _vi, ` --+=++++: " RESET, -GREEN " .uvnvi. _._ -==+==+. " RESET, -GREEN " .vvnvnI` .;==|==;. :|=||=|. " RESET, -GREY "+QmQQm" GREEN "pvvnv; " GREY "_yYsyQQWUUQQQm #QmQ#" GREEN ":" GREY "QQQWUV$QQm. " RESET, -GREY " -QQWQW" GREEN "pvvo" GREY "wZ?.wQQQE" GREEN "==<" GREY "!QWWQ/QWQW.QQWW" GREEN "(: " GREY "jQWQE " RESET, -GREY " -$QQQQmmU' jQQQ@" GREEN "+=<" GREY "QWQQ)mQQQ.mQQQC" GREEN "+;" GREY "jWQQ@' " RESET, -GREY " -$WQ8Y" GREEN "nI: " GREY "QWQQwgQQWV" GREEN"`" GREY "mWQQ.jQWQQgyyWW@! " RESET, -GREEN " -1vvnvv. `~+++` ++|+++ " RESET, -GREEN " +vnvnnv, `-|=== " RESET, -GREEN " +vnvnvns. . :=- " RESET, -GREEN " -Invnvvnsi..___..=sv=. ` " RESET, -GREEN " +Invnvnvnnnnnnnnvvnn;. " RESET, -GREEN " ~|Invnvnvvnvvvnnv}+` " RESET, -GREEN " -~|{*l}*|~ " RESET, -GREEN " " RESET, -GREEN " " RESET -}; - -char *LOGO_SMALL[] = { -GREEN " _______ " RESET, -GREEN " _ \\______ - " RESET, -GREEN "| \\ ___ \\ | " RESET, -GREEN "| | / \\ | | " RESET, -GREEN "| | \\___/ | | " RESET, -GREEN "| \\______ \\_| " RESET, -GREEN " -_______\\ " RESET -};