aboutsummaryrefslogtreecommitdiff
path: root/bat.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-02 20:33:58 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-02 20:33:58 +0200
commit0e863a52491851b69a2e4a4865bd65fe37496d22 (patch)
treea20fe1ed38acb83baedb1ba3e701433f517d6ae3 /bat.lua
parent44f95c3651b145c9df9154c639412d66b8439439 (diff)
downloadvicious-legacy-0e863a52491851b69a2e4a4865bd65fe37496d22.tar.xz
bat: coding style changes
Diffstat (limited to 'bat.lua')
-rw-r--r--bat.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/bat.lua b/bat.lua
index 281af30..78ce4bf 100644
--- a/bat.lua
+++ b/bat.lua
@@ -31,9 +31,9 @@ local function worker(format, batid)
}
-- Get /proc/acpi/battery info
- local finfo = io.open("/proc/acpi/battery/"..batid.."/info")
- local infofile = finfo:read("*all")
- finfo:close()
+ local f = io.open("/proc/acpi/battery/"..batid.."/info")
+ local infofile = f:read("*all")
+ f:close()
-- Check if the file wasn't found or the battery isn't present
if infofile == nil or string.find(infofile, "present:[%s]+no") then
@@ -44,9 +44,9 @@ local function worker(format, batid)
-- Get /proc/acpi/battery state
- local fstate = io.open("/proc/acpi/battery/"..batid.."/state")
- local statefile = fstate:read("*all")
- fstate:close()
+ local f = io.open("/proc/acpi/battery/"..batid.."/state")
+ local statefile = f:read("*all")
+ f:close()
-- Get state information
local state = string.match(statefile, "charging state:[%s]+([%a]+).*")