Fixed broken uptime value and added days

This commit is contained in:
LukeHuckman 2021-04-16 00:25:38 +08:00
parent 63ea7dbba9
commit 034a1c22c7

View file

@ -246,8 +246,12 @@ void print_info()
printf("\033[18C%s%sPKGS %s%s%d %s\n",
NORMAL, BOLD, NORMAL, NORMAL, pkgs, pkgman_name);
if (show_uptime)
if(sys.uptime/3600 < 24)
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);
NORMAL, BOLD, NORMAL, sys.uptime/3600, sys.uptime/60%60);
else
printf("\033[18C%s%sUWUPTIME %s" /*"%lid, "*/ "%lid, %lih, %lim\n",
NORMAL, BOLD, NORMAL, sys.uptime/86400, sys.uptime/3600%24, sys.uptime/60%60);
if (show_colors)
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);
@ -307,7 +311,7 @@ void get_info()
// system resources
uname(&sys_var);
//sysinfo(&sys); // somehow this function has to be called again in print_info()
sysinfo(&sys); // somehow this function has to be called again in print_info()
truncate_name(sys_var.release);
sprintf(kernel, "%s %s %s", sys_var.sysname, sys_var.release, sys_var.machine);