aboutsummaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authorJ. Thalheim <jthalheim@gmail.com>2011-11-19 02:24:34 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2011-11-19 02:24:34 +0100
commitcd4b04df44023f9c81885978522f337763dcf7a9 (patch)
treec10c5c3d35053131dd45bd37762217f32b588712 /widgets
parent350e9240ea792446efb22564060384f535ac4e34 (diff)
downloadvicious-legacy-cd4b04df44023f9c81885978522f337763dcf7a9.tar.xz
thermal: remove unnecessary read
Diffstat (limited to 'widgets')
-rw-r--r--widgets/thermal.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/widgets/thermal.lua b/widgets/thermal.lua
index 4d837c8..1906568 100644
--- a/widgets/thermal.lua
+++ b/widgets/thermal.lua
@@ -30,11 +30,12 @@ local function worker(format, warg)
-- Get temperature from thermal zone
local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1])
- if thermal[zone[warg[2]].file] then
+ local data = thermal[zone[warg[2]].file]
+ if data then
if zone[warg[2]].div then
- return {thermal[zone[warg[2]].file] / zone[warg[2]].div}
+ return {data / zone[warg[2]].div}
else -- /proc/acpi "temperature: N C"
- return {tonumber(string.match(thermal[zone[warg[2]].file], "[%d]+"))}
+ return {tonumber(string.match(data, "[%d]+"))}
end
end