summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
author諏訪子 <suwako@076.moe>2024-06-19 19:38:19 +0900
committer諏訪子 <suwako@076.moe>2024-06-19 19:38:19 +0900
commit9941a4d3d29f99a46e7f27bcad3653af87e26731 (patch)
tree4bed2c208d6df291feae0c40b0de6d2dd9bb4e56 /main.c
parentc73167415c76ec418fa2aa3ef45df6b3e0d55df8 (diff)
ロゴのコードの再書
Diffstat (limited to 'main.c')
-rw-r--r--main.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/main.c b/main.c
index 9895176..11d5f9f 100644
--- a/main.c
+++ b/main.c
@@ -5,7 +5,6 @@
#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"
@@ -28,13 +27,16 @@ int main(int argc, char *argv[]) {
}
#if defined(__OpenBSD__)
#include "src/logo/openbsd.h"
+ getOS();
#elif defined(__NetBSD__)
#include "src/logo/netbsd.h"
+ getOS();
#elif defined(__FreeBSD__)
#include "src/logo/freebsd.h"
+ getOS();
#elif defined(__linux__)
- getDistro(distroname);
#include "src/logo/linux.h"
+ getDistro(distroname);
#else
#define COLOR "\e[1;30m"
#define RESET "\e[0m"
@@ -76,11 +78,11 @@ int main(int argc, char *argv[]) {
}
printf("%s ", LOGO[lc]);
- printf(COLOR);
+ printf("%s", titlecolor);
display_user_name();
printf(RESET);
printf("@");
- printf(COLOR);
+ printf("%s", titlecolor);
display_user_host();
printf(RESET);
lc++;
@@ -89,7 +91,7 @@ int main(int argc, char *argv[]) {
lc++;
printf("%s ", LOGO[lc]);
- printf(COLOR"%s%s"RESET, "OS", ": ");
+ printf("%s%s%s"RESET, color, "OS", ": ");
display_os_name();
printf(" ");
display_os_vers();
@@ -107,13 +109,13 @@ int main(int argc, char *argv[]) {
#endif
printf("%s ", LOGO[lc]);
- printf(COLOR"%s%s"RESET, "Host", ": ");
+ printf("%s%s%s"RESET, color, "Host", ": ");
display_host_model();
printf("\n");
lc++;
printf("%s ", LOGO[lc]);
- printf(COLOR"%s%s"RESET, "Uptime", ": ");
+ printf("%s%s%s"RESET, color, "Uptime", ": ");
display_days();
printf(", ");
display_time();
@@ -122,7 +124,7 @@ int main(int argc, char *argv[]) {
#if defined(__OpenBSD__)
printf("%s ", LOGO[lc]);
- printf(COLOR"%s%s"RESET, "Recording", ": ");
+ printf("%s%s%s"RESET, color, "Recording", ": ");
printf("audio = ");
display_recording_audio();
printf(", video = ");
@@ -132,26 +134,26 @@ int main(int argc, char *argv[]) {
#endif
printf("%s ", LOGO[lc]);
- printf(COLOR"%s%s"RESET, "Packages", ": ");
+ printf("%s%s%s"RESET, color, "Packages", ": ");
display_packages();
printf("\n");
lc++;
printf("%s ", LOGO[lc]);
- printf(COLOR"%s%s"RESET, "CPU", ": ");
+ printf("%s%s%s"RESET, color, "CPU", ": ");
display_cpu();
printf("\n");
lc++;
if (display_gpu()) {
printf("%s ", LOGO[lc]);
- printf(COLOR"%s%s"RESET, "GPU", ": ");
+ printf("%s%s%s"RESET, color, "GPU", ": ");
printf("%s\n", display_gpu());
lc++;
}
printf("%s ", LOGO[lc]);
- printf(COLOR"%s%s"RESET, "Memory", ": ");
+ printf("%s%s%s"RESET, color, "Memory", ": ");
display_memory();
printf("\n");
lc++;
@@ -169,5 +171,6 @@ int main(int argc, char *argv[]) {
// * 端末
// * GPU
// * ストレージ
+
return 0;
}