RexxGauge
BGNDCOL=CCCCCC;TEXTCOL=000084;FONT=9.WarpSans;COLOR1=FFFF00;COLOR2=FFBA00;COLOR3=FF0000;SCRIPT=/* Swap monitor */%0D%0A%0D%0A/* -- User configurable section   ---------------------------- */%0D%0ASwapperDrive %3D @@SwapperDrive@@ %0D%0ASwapperPath %3D @@SwapperPath@@ %0D%0ASwapMinFree %3D @@SwapMinFree@@ %0D%0ASwapInit %3D @@SwapInit@@ %0D%0A/* -- Do not edit below this line! --------------------------- */%0D%0A%0D%0A%0D%0Aif RxFuncQuery('SysLoadFuncs') then do%0D%0A%09call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'%0D%0A%09call SysLoadFuncs%0D%0Aend%0D%0A  %0D%0Aparse value SysDriveInfo(SwapperDrive) with dsk free total label%0D%0A%0D%0ATheFile %3D SwapperDrive || SwapperPath || '\swapper.dat'%0D%0Asize %3D stream(TheFile, 'c', 'query size')%0D%0A%0D%0Aswsize %3D ((size / 1024) / 1024)%0D%0Agauge.tooltip %3D 'Swapper size: ' || swsize || 'Mb'%0D%0A%0D%0ASwapInit2 %3D SwapInit * 1024%0D%0At_init %3D 100 * (SwapInit2 / (free + SwapInit2 - (SwapMinFree * 1024)))%0D%0At_init %3D format(t_init, 2, 0)%0D%0A%0D%0At %3D 100 * (size / (free + size - (SwapMinFree * 1024)))%0D%0At %3D format(t, 2, 0)%0D%0A%0D%0Aselect%0D%0A%09when t <%3D t_init then%0D%0A%09%09gauge.1 %3D t%0D%0A%09when ((t <%3D 90) & (t > t_init)) then do%0D%0A%09%09gauge.1 %3D t_init%0D%0A%09%09gauge.2 %3D t%0D%0A%09%09gauge.foreground %3D '0000FF'%0D%0A%09end%0D%0A%09otherwise%0D%0A%09%09gauge.1 %3D t_init%0D%0A%09%09gauge.2 %3D 90%0D%0A%09%09gauge.3 %3D t%0D%0A%09%09gauge.foreground %3D 'FF0000'%0D%0Aend%0D%0A%0D%0Agauge.text %3D t'%25'%0D%0A%0D%0A;DBLCLK=/* OS/2 Kernel settings notebook */%0D%0A  %0D%0Aif RxFuncQuery('SysLoadFuncs') then do%0D%0A%09call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'%0D%0A%09call SysLoadFuncs%0D%0Aend%0D%0A  %0D%0Acall SysSetObjectData '<XWP_KERNEL>', 'OPEN%3DSETTINGS'%0D%0A%0D%0A;TITLE=Swap Space Monitor;HEIGHT=10;WIDTH=40;REFRESH=5000;