Warning: session_start(): open(/var/lib/php/sessions/sess_721l7onq5msmnm8aas3g65n2sr, 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
sclass SystemCPUTrayIcon extends DynBigNumber {
transient BufferedImage trayImage;
transient TrayIcon trayIcon;
int size = 20;
start {
setDescription("SYSTEM CPU %");
setToolTip("Percentage is per core (max=" + numberOfCores()*100 + "%)");
ownTimer(doEvery(2.0, r actualUpdate));
ownResource(tempTrayIcon(trayIcon = installTrayIcon(trayImage = whiteImage(size, size), "System CPU")));
}
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);
int y = iround((h-1)*(1-load));
fillRect(trayImage, w-1, 0, 1, y, Color.white);
fillRect(trayImage, w-1, y, 1, h-y, Color.orange);
trayIcon.setImage(trayImage);
}
}