Code cleanup
This commit is contained in:
parent
8d53fe306e
commit
fd1b9e6cfc
1 changed files with 2 additions and 3 deletions
|
@ -338,7 +338,8 @@ void print_info()
|
||||||
#else
|
#else
|
||||||
uptime = sys.uptime;
|
uptime = sys.uptime;
|
||||||
#endif
|
#endif
|
||||||
switch (uptime) {
|
switch (uptime)
|
||||||
|
{
|
||||||
case 0 ... 3599:
|
case 0 ... 3599:
|
||||||
printf("\033[18C%s%sUWUPTIME %s%lim\n",
|
printf("\033[18C%s%sUWUPTIME %s%lim\n",
|
||||||
NORMAL, BOLD, NORMAL, uptime / 60 % 60);
|
NORMAL, BOLD, NORMAL, uptime / 60 % 60);
|
||||||
|
@ -458,10 +459,8 @@ void get_info()
|
||||||
|
|
||||||
meminfo = popen("LANG=EN_us free -m 2> /dev/null", "r");
|
meminfo = popen("LANG=EN_us free -m 2> /dev/null", "r");
|
||||||
while (fgets(line, sizeof(line), meminfo))
|
while (fgets(line, sizeof(line), meminfo))
|
||||||
{
|
|
||||||
// free command prints like this: "Mem:" total used free shared buff/cache available
|
// free command prints like this: "Mem:" total used free shared buff/cache available
|
||||||
sscanf(line, "Mem: %d %d", &ram_total, &ram_used);
|
sscanf(line, "Mem: %d %d", &ram_total, &ram_used);
|
||||||
}
|
|
||||||
fclose(meminfo);
|
fclose(meminfo);
|
||||||
#else
|
#else
|
||||||
//wmic OS get FreePhysicalMemory
|
//wmic OS get FreePhysicalMemory
|
||||||
|
|
Loading…
Reference in a new issue