From 2c01cb6f8b9a6352184e0000c0cc1144e7765b3d Mon Sep 17 00:00:00 2001 From: joten Date: Sun, 30 Sep 2012 19:52:06 +0200 Subject: [PATCH] added the library 'ResourceMonitor.ahk' --- src/ResourceMonitor.ahk | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/ResourceMonitor.ahk diff --git a/src/ResourceMonitor.ahk b/src/ResourceMonitor.ahk new file mode 100644 index 0000000..959932a --- /dev/null +++ b/src/ResourceMonitor.ahk @@ -0,0 +1,52 @@ +/* + bug.n -- tiling window management + Copyright (c) 2010-2012 Joshua Fuhs, joten + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + @version 8.3.0 +*/ + +ResourceMonitor_getText() +{ + Global Config_readinCpu, Config_readinDate, Config_readinDiskLoad, Config_readinMemoryUsage, Config_readinNetworkLoad + + text := "" + If Config_readinCpu + text .= " CPU: " Bar_getSystemTimes() "% " + If Config_readinMemoryUsage + { + If Config_readinCpu + text .= "|" + text .= " RAM: " Bar_getMemoryUsage() "% " + } + If Config_readinDiskLoad + { + If (Config_readinCpu Or Config_readinMemoryUsage) + text .= "|" + Bar_getDiskLoad(rLoad, wLoad) + text .= " Dr: " rLoad "% | Dw: " wLoad "% " + } + If Config_readinNetworkLoad + { + If (Config_readinCpu Or Config_readinMemoryUsage Or Config_readinDiskLoad) + text .= "|" + Bar_getNetworkLoad(upLoad, dnLoad) + text .= " UP: " upLoad " KB/s | dn: " dnLoad " KB/s " + } + If Config_readinDate And (Config_readinCpu Or Config_readinMemoryUsage Or Config_readinDiskLoad Or Config_readinNetworkLoad) + text .= "|" + + Return, text +}