Warning: session_start(): open(/var/lib/php/sessions/sess_pnfftsdq86bkib1fo4e7f3vekp, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cmodule SystemCPUTrayIcon > DynBigNumber {
transient BufferedImage trayImage;
transient TrayIcon trayIcon;
switchable S color = "FD6A02";
switchable int size = goodSystemTrayIconSize().x;
switchable double interval = 1;
start {
setDescription("SYSTEM CPU %");
setToolTip("Percentage is per core (max=" + numberOfCores()*100 + "%)");
ownTimer(doEvery(interval, r actualUpdate));
ownResource(tempTrayIcon(trayIcon = installTrayIcon(trayImage = whiteImage(size, size), "System CPU", rThread dm_activateOSAndModule)));
}
void actualUpdate {
double load = systemCPULoad();
setValue(toIntPercent_ceil(load*numberOfCores()) + " %");
int w = trayImage.getWidth(), h = trayImage.getHeight();
copyImagePart(trayImage, 1, 0, trayImage, 0, 0, w-1, h);
double fullY = (h-1)*(1-load);
int y = iceil(fullY);
Color fg = colorFromHex(color), bg = Color.white;
fillRect(trayImage, w-1, 0, 1, y, bg);
fillRect(trayImage, w-1, y, 1, h-y, fg);
if (y > 0)
trayImage.setRGB(w-1, y-1, blendColor(fg, bg, y-fullY));
trayIcon.setImage(trayImage);
}
}