aboutsummaryrefslogtreecommitdiff
path: root/thermal.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-05 00:10:47 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-05 00:10:47 +0200
commit4602ca2fa5e8e2e408713f72ae7e4cd14480bc01 (patch)
treebfbf75b8afd738f5a036737404f3eafe87586c66 /thermal.lua
parentaf4e85f99d0ac63127f19640ef47d768d7bed7cd (diff)
downloadvicious-legacy-4602ca2fa5e8e2e408713f72ae7e4cd14480bc01.tar.xz
Lots of coding style changes
Diffstat (limited to 'thermal.lua')
-rw-r--r--thermal.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/thermal.lua b/thermal.lua
index ab7ef89..1697eb0 100644
--- a/thermal.lua
+++ b/thermal.lua
@@ -6,6 +6,7 @@
-- {{{ Grab environment
local io = { open = io.open }
local setmetatable = setmetatable
+local string = { match = string.match }
-- }}}
@@ -16,13 +17,13 @@ module("vicious.thermal")
-- {{{ Thermal widget type
local function worker(format, thermal_zone)
-- Get an ACPI thermal zone
- local f = io.open("/proc/acpi/thermal_zone/" .. thermal_zone .. "/temperature")
+ local f = io.open("/proc/acpi/thermal_zone/"..thermal_zone.."/temperature")
-- Handler for incompetent users
if not f then return {"N/A"} end
local line = f:read("*line")
f:close()
- local temperature = line:match("[%d]?[%d]?[%d]")
+ local temperature = string.match(line, "[%d]?[%d]?[%d]")
return {temperature}
end