aboutsummaryrefslogtreecommitdiff
path: root/batat.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 /batat.lua
parentaf4e85f99d0ac63127f19640ef47d768d7bed7cd (diff)
downloadvicious-legacy-4602ca2fa5e8e2e408713f72ae7e4cd14480bc01.tar.xz
Lots of coding style changes
Diffstat (limited to 'batat.lua')
-rw-r--r--batat.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/batat.lua b/batat.lua
index b160dc7..2e40d9f 100644
--- a/batat.lua
+++ b/batat.lua
@@ -7,6 +7,7 @@
local io = { popen = io.popen }
local setmetatable = setmetatable
local table = { insert = table.insert }
+local string = { match = string.match }
-- }}}
@@ -30,12 +31,12 @@ local function worker(format)
for line in f:lines() do
-- Check if the battery is present
- if line:match("^[%s]+Battery.*") then
+ if string.match(line, "^[%s]+Battery.*") then
-- Store state and charge information
- table.insert(battery_info, (battery_state[line:match("([%a]*),")] or "/"))
- table.insert(battery_info, (line:match("([%d]?[%d]?[%d])%.") or "/"))
+ table.insert(battery_info, (battery_state[string.match(line, "([%a]*),")] or "/"))
+ table.insert(battery_info, (string.match(line, "([%d]?[%d]?[%d])%.") or "/"))
-- Store remaining time information
- table.insert(battery_info, (line:match("%%,%s(.*)") or "/"))
+ table.insert(battery_info, (string.match(line, "%%,%s(.*)") or "/"))
else
return {"/", "/", "/"}
end