diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-08-05 21:50:41 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-08-05 21:50:41 +0200 |
commit | 4c74de711f564d26ebefef7f9422289bd76ef8c2 (patch) | |
tree | 404eb00b19214c8455dc1d0397d34353b895efce /uptime.lua | |
parent | 2d4efa6893a582a7bc6a15b4840a116c0547b534 (diff) | |
download | vicious-legacy-4c74de711f564d26ebefef7f9422289bd76ef8c2.tar.xz |
Padding removed, along with deprecated helper functions.
If you have any use for it then continue using an older vicious tag,
or keep maintaining it in your local vicious copy.
Diffstat (limited to 'uptime.lua')
-rw-r--r-- | uptime.lua | 19 |
1 files changed, 1 insertions, 18 deletions
@@ -8,7 +8,6 @@ local tonumber = tonumber local io = { open = io.open } local setmetatable = setmetatable local math = { floor = math.floor } -local helpers = require("vicious.helpers") -- }}} @@ -17,7 +16,7 @@ module("vicious.uptime") -- {{{ Uptime widget type -function worker(format, padding) +function worker(format) -- Get /proc/uptime local f = io.open("/proc/uptime") local line = f:read("*line") @@ -31,22 +30,6 @@ function worker(format, padding) local uptime_minutes = math.floor(((total_uptime % (3600 * 24)) % 3600) / 60) local uptime_seconds = math.floor(((total_uptime % (3600 * 24)) % 3600) % 60) - if padding then - if type(padding) == "table" then - total_uptime = helpers.padd(total_uptime, padding[1]) - uptime_days = helpers.padd(uptime_days, padding[2]) - uptime_hours = helpers.padd(uptime_hours, padding[3]) - uptime_minutes = helpers.padd(uptime_minutes, padding[4]) - uptime_seconds = helpers.padd(uptime_seconds, padding[5]) - else - total_uptime = helpers.padd(total_uptime, padding) - uptime_days = helpers.padd(uptime_days, padding) - uptime_hours = helpers.padd(uptime_hours, padding) - uptime_minutes = helpers.padd(uptime_minutes, padding) - uptime_seconds = helpers.padd(uptime_seconds, padding) - end - end - return {total_uptime, uptime_days, uptime_hours, uptime_minutes, uptime_seconds} end -- }}} |