diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-05 00:10:47 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-05 00:13:38 +0200 |
commit | d81eed6d310bce28b3709980d80c433a04eefaae (patch) | |
tree | 3ab65939b04a86d22e39ad6a4a5ac3ab122257b8 /batat.lua | |
parent | c2b68ad3e78e366e611600f54dcfa8d760ed026f (diff) | |
download | vicious-legacy-d81eed6d310bce28b3709980d80c433a04eefaae.tar.xz |
Lots of coding style changes
Diffstat (limited to 'batat.lua')
-rw-r--r-- | batat.lua | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |