commit - 0c9b1cfd36c0d05942fa0e65d75536a4dc6ce748
commit + caaad6cc0ef9c3816363b7795641aaa5f4740934
blob - d5622d190215cff29e190bac9443971f3ea333ae
blob + b13780e301a8338e272953415bb7f4951764d0ea
--- apmtop.c
+++ apmtop.c
ret = sysctl (mib, 5, &sensor, &len, NULL, 0);
- return (ret == -1 || sensor.status & SENSOR_FINVALID) ? -1 : sensor.value / 10000000;
+ return (ret == -1 || sensor.status & SENSOR_FINVALID) ? -1 : ((sensor.value - 273150000) / 1000000);
}
static int
w -= 2;
h -= 3;
- wclear (g->win);
+ werase (g->win);
for (int i = 0; i < entries; ++i) {
int v = g->log[i];
static void
draw (struct display *dpy)
{
- clear ();
+ erase ();
draw_graph (&dpy->g[G_CPUUSAGE], "CPU: %d%%", 0, 100);
draw_graph (&dpy->g[G_CPUTEMP], "CPU: %d C", 0, 100);
printw (" %c delay=%d", dpy->running ? 'R' : 'S', dpy->delay);
- refresh ();
+ wnoutrefresh (stdscr);
for (int i = 0; i < NGRAPH; ++i)
wnoutrefresh (dpy->g[i].win);
doupdate ();
- move (0, 0);
-
}
static void