From 493150c88899572fad92aa04457c90027740aca5 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Wed, 11 Nov 2009 03:55:03 +0100 Subject: uptime: merged with load widget type Total uptime and seconds are no longer returned. Returns are now: days, hours, minutes, load avg 1, load avg 5 and load avg 15. --- load.lua | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 load.lua (limited to 'load.lua') diff --git a/load.lua b/load.lua deleted file mode 100644 index 7b5cb4d..0000000 --- a/load.lua +++ /dev/null @@ -1,31 +0,0 @@ ---------------------------------------------------- --- Licensed under the GNU General Public License v2 --- * (c) 2009, Adrian C. ---------------------------------------------------- - --- {{{ Grab environment -local tonumber = tonumber -local io = { open = io.open } -local setmetatable = setmetatable -local string = { match = string.match } --- }}} - - --- Load: provides system load averages for the past 1, 5, and 15 minutes -module("vicious.load") - - --- {{{ Load widget type -local function worker(format) - local f = io.open('/proc/loadavg') - local line = f:read("*line") - f:close() - - local l1, l5, l15 = -- Get load averages for past 1, 5 and 15 minutes - string.match(line, "([%d]*%.[%d]*)%s([%d]*%.[%d]*)%s([%d]*%.[%d]*)") - - return {tonumber(l1), tonumber(l5), tonumber(l15)} -end --- }}} - -setmetatable(_M, { __call = function(_, ...) return worker(...) end }) -- cgit v1.2.3