diff options
author | Arvydas Sidorenko <asido4@gmail.com> | 2012-06-15 18:07:05 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2012-06-18 01:26:31 +0200 |
commit | 41cc2c0e27e6a0860d21754ed9d13f6cd61254ac (patch) | |
tree | 20ed8fe7b878caec0c9e033168fe79561f31db57 /widgets/thermal.lua | |
parent | b6b52900930ddb2a5b958a6d314766b455358164 (diff) | |
download | vicious-legacy-41cc2c0e27e6a0860d21754ed9d13f6cd61254ac.tar.xz |
Ported vicious.widgets module to lua 5.2
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Diffstat (limited to 'widgets/thermal.lua')
-rw-r--r-- | widgets/thermal.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/widgets/thermal.lua b/widgets/thermal.lua index c81431f..7592b72 100644 --- a/widgets/thermal.lua +++ b/widgets/thermal.lua @@ -13,7 +13,8 @@ local helpers = require("vicious.helpers") -- Thermal: provides temperature levels of ACPI and coretemp thermal zones -module("vicious.widgets.thermal") +-- vicious.widgets.thermal +local thermal = {} -- {{{ Thermal widget type @@ -28,9 +29,9 @@ local function worker(format, warg) warg = type(warg) == "table" and warg or { warg, "sys" } -- Get temperature from thermal zone - local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1]) + local _thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1]) - local data = warg[3] and thermal[warg[3]] or thermal[zone[warg[2]].file] + local data = warg[3] and _thermal[warg[3]] or _thermal[zone[warg[2]].file] if data then if zone[warg[2]].div then return {data / zone[warg[2]].div} @@ -43,4 +44,4 @@ local function worker(format, warg) end -- }}} -setmetatable(_M, { __call = function(_, ...) return worker(...) end }) +return setmetatable(thermal, { __call = function(_, ...) return worker(...) end }) |