diff --git a/uwufetch.c b/uwufetch.c index 5e0868a..9acee22 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -142,26 +142,34 @@ int pkgman() { // this is just a function that returns the total of installed pa return total; } -void print_info() { - // print collected info - from host to cpu info - printf("\033[9A\033[18C%s%s%s@%s\n", NORMAL, BOLD, user, host); - printf("\033[18C%s%sOWOS %s%s\n", NORMAL, BOLD, NORMAL, version_name); - printf("\033[18C%s%sKEWNEL %s%s %s\n", NORMAL, BOLD, NORMAL, sys_var.release, sys_var.machine); - printf("\033[18C%s%sCPUWU %s%s\n", NORMAL, BOLD, NORMAL, cpu_model); +void print_info() { + // store sys info in the sys again + sysinfo(&sys); + // print collected info - from host to cpu info + printf("\033[9A\033[18C%s%s%s@%s\n", NORMAL, BOLD, user, host); + printf("\033[18C%s%sOWOS %s%s\n", NORMAL, BOLD, NORMAL, version_name); + printf("\033[18C%s%sKEWNEL %s%s %s\n", NORMAL, BOLD, NORMAL, sys_var.release, sys_var.machine); + printf("\033[18C%s%sCPUWU %s%s\n", NORMAL, BOLD, NORMAL, cpu_model); - // print the gpus - int gpu_iter = 0; - while (gpu_model[gpu_iter][0] != '0') { - printf("\033[18C%s%sGPUWU %s%s\n", NORMAL, BOLD, NORMAL, gpu_model[gpu_iter]); - gpu_iter++; - } + // print the gpus + int gpu_iter = 0; + while(gpu_model[gpu_iter][0] != '0') { + printf( "\033[18C%s%sGPUWU %s%s\n", + NORMAL, BOLD, NORMAL, gpu_model[gpu_iter]); + gpu_iter++; + } - // print ram to uptime and colors - printf("\033[18C%s%sWAM %s%i MB/%i MB\n", NORMAL, BOLD, NORMAL, (ram_used), ram_total); - printf("\033[18C%s%sSHELL %s%s\n", NORMAL, BOLD, NORMAL, shell); - printf("\033[18C%s%sPKGS %s%s%d %s\n", NORMAL, BOLD, NORMAL, NORMAL, pkgs, pkgman_name); - printf("\033[18C%s%sUWUPTIME %s" /*"%lid, " */ "%lih, %lim\n", NORMAL, BOLD, NORMAL, /*sys.uptime/60/60/24, */ sys.uptime / 60 / 60, sys.uptime / 60 % 60); - printf("\033[18C%s%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\n", BOLD, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, NORMAL); + // print ram to uptime and colors + printf("\033[18C%s%sWAM %s%i MB/%i MB\n", + NORMAL, BOLD, NORMAL, (ram_used), ram_total); + printf("\033[18C%s%sSHELL %s%s\n", + NORMAL, BOLD, NORMAL, shell); + printf("\033[18C%s%sPKGS %s%s%d %s\n", + NORMAL, BOLD, NORMAL, NORMAL, pkgs, pkgman_name); + printf("\033[18C%s%sUWUPTIME %s"/*"%lid, "*/"%lih, %lim\n", + NORMAL, BOLD, NORMAL, /*sys.uptime/60/60/24,*/ sys.uptime/60/60, sys.uptime/60%60); + printf("\033[18C%s%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\u2587\u2587%s\n", + BOLD, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, NORMAL); } void get_info() { // get all necessary info @@ -209,7 +217,7 @@ void get_info() { // get all necessary info // system resources uname(&sys_var); - sysinfo(&sys); + sysinfo(&sys); // somehow this function has to be called again in print_info() truncate_name(sys_var.release); truncate_name(sys_var.machine);