From 5c50c6cbd2e40c3b801402a61187892b1edf801d Mon Sep 17 00:00:00 2001 From: 8nlight <8nlight@disroot.org> Date: Sun, 6 Aug 2023 12:00:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- funcs.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/funcs.h b/funcs.h index 6f38b43..3a3f97b 100644 --- a/funcs.h +++ b/funcs.h @@ -25,7 +25,6 @@ typedef struct { } LOGO; char *Os; -char *Color; LOGO Logo; struct utsname Uts; @@ -47,7 +46,6 @@ void Init(void) { Os = GetOs(); Logo = GetArt(); - Color = Logo.color; if (uname(&Uts) < 0) { fprintf(stderr, "WTF, uname dont work\n"); exit(1); @@ -58,28 +56,28 @@ void Init(void) { void GetShell(void) { char *shell = getenv("SHELL"); if (shell == NULL) { - printf("%s SHELL \033[37mNothing\033[0m", Color); + printf("%s SHELL \033[37mNothing\033[0m", Logo.color); return; } char *splt = strrchr(shell, '/'); if (splt != NULL) - printf("%s SHELL \033[37m%s\033[0m", Color, splt + 1); + printf("%s SHELL \033[37m%s\033[0m", Logo.color, splt + 1); } void GetKernel(void) { - printf("%s KERNEL \033[37m%s\033[0m", Color, Uts.release); + printf("%s KERNEL \033[37m%s\033[0m", Logo.color, Uts.release); } void PrintOs(void) { if (Os == NULL) { - printf("%s OS \033[37mUnknow\033[0m", Color); + printf("%s OS \033[37mUnknow\033[0m", Logo.color); return; } - printf("%s OS \033[37m%s\033[0m", Color, Os + strlen("PRETTY_NAME= ")); + printf("%s OS \033[37m%s\033[0m", Logo.color, Os + strlen("PRETTY_NAME= ")); } @@ -91,10 +89,10 @@ void GetUptime(void) { int UptimeH = uptime.tv_sec / 3600; int UptimeM = (uptime.tv_sec / 60) - (uptime.tv_sec / 3600 * 60); - printf("%s UPTIME \033[37m%dh %dm\033[0m", Color, UptimeH, UptimeM); + printf("%s UPTIME \033[37m%dh %dm\033[0m", Logo.color, UptimeH, UptimeM); #else - printf("%s UPTIME \033[37m0h 0m\033[0m", Color); + printf("%s UPTIME \033[37m0h 0m\033[0m", Logo.color); #endif } @@ -102,18 +100,18 @@ void GetUptime(void) { void GetUser(void) { struct passwd *pw = getpwuid(geteuid()); - printf("%s USER \033[37m%s\033[0m", Color, pw->pw_name); + printf("%s USER \033[37m%s\033[0m", Logo.color, pw->pw_name); } void GetPkgs(void) { if (Logo.pkg_cmd == NULL) { - printf("%s PKGS \033[37m0", Color); + printf("%s PKGS \033[37m0", Logo.color); return; } FILE *fp = popen(Logo.pkg_cmd, "r"); - printf("%s PKGS \033[37m", Color); + printf("%s PKGS \033[37m", Logo.color); char ch; while ((ch = fgetc(fp)) != '\n')