Title: Swap Space Monitor
======

Refresh rate: 5000 ms
=============

Gauge width: 40 pixels (fixed)
============

Rexx code: (Gauge script)
=========================

/* Swap monitor */

/* -- User configurable section   ---------------------------- */
SwapperDrive = 'E:'
SwapperPath = '\os2\system'
SwapMinFree = 30720
/* -- Do not edit below this line! --------------------------- */


if RxFuncQuery('SysLoadFuncs') then do
	call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
	call SysLoadFuncs
end
  
parse value SysDriveInfo(SwapperDrive) with dsk free total label

TheFile = SwapperDrive || SwapperPath || '\swapper.dat'
size = stream(TheFile, 'c', 'query size')

swsize = ((size / 1024) / 1024)
gauge.tooltip = 'Swapper size: ' || swsize || 'Mb'
  
t = 100 * ((free - (SwapMinFree * 1000)) - size) % free
t = 100 - t

select
	when t < 75 then
		gauge.1 = t
	when t < 90 then do
		gauge.1 = 74
		gauge.2 = t
	end
	otherwise
		gauge.1 = 74
		gauge.2 = 89
		gauge.3 = t
end

gauge.text = t'%'



Rexx code: (Double click action)
================================

/* OS/2 Kernel settings notebook */
  
if RxFuncQuery('SysLoadFuncs') then do
	call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
	call SysLoadFuncs
end
  
call SysSetObjectData '<XWP_KERNEL>', 'OPEN=SETTINGS'


