Coding style fixes in battery widgets.
This commit is contained in:
parent
052748a2cb
commit
bc637062d7
4
bat.lua
4
bat.lua
|
@ -37,7 +37,7 @@ function worker(format, batid)
|
||||||
|
|
||||||
-- Check if the file wasn't found or the battery isn't present
|
-- Check if the file wasn't found or the battery isn't present
|
||||||
if infofile == nil or string.find(infofile, "present:[%s]+no") then
|
if infofile == nil or string.find(infofile, "present:[%s]+no") then
|
||||||
return { "/", "/", "/" }
|
return {"/", "/", "/"}
|
||||||
else
|
else
|
||||||
-- Get capacity information
|
-- Get capacity information
|
||||||
local capacity = string.match(infofile, "last full capacity:[%s]+([%d]+).*")
|
local capacity = string.match(infofile, "last full capacity:[%s]+([%d]+).*")
|
||||||
|
@ -73,7 +73,7 @@ function worker(format, batid)
|
||||||
local minutesleft = math.floor((timeleft - hoursleft) * 60 )
|
local minutesleft = math.floor((timeleft - hoursleft) * 60 )
|
||||||
local time = string.format("%02d:%02d", hoursleft, minutesleft)
|
local time = string.format("%02d:%02d", hoursleft, minutesleft)
|
||||||
|
|
||||||
return { state, percent, time }
|
return {state, percent, time}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
|
@ -38,7 +38,7 @@ function worker(format)
|
||||||
-- Store remaining time information
|
-- Store remaining time information
|
||||||
table.insert(battery_info, (line:match("%%,%s(.*)") or "/"))
|
table.insert(battery_info, (line:match("%%,%s(.*)") or "/"))
|
||||||
else
|
else
|
||||||
return { "/", "/", "/" }
|
return {"/", "/", "/"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
f:close()
|
f:close()
|
||||||
|
|
Loading…
Reference in New Issue