diff options
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 }) |