X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/e73a70c2ab26caf981d356756d4f83ad8bfbdb5a..4cd75de2ed52f4bc39ad52eee7d5155c6036ce0e:/widgets/bat.lua diff --git a/widgets/bat.lua b/widgets/bat.lua index fa61c34..ba1fa58 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -30,14 +30,14 @@ local function worker(args) bat.widget = wibox.widget.textbox('') - bat_now = { - status = "not present", - perc = "N/A", - time = "N/A", - watt = "N/A" - } - function bat.update() + bat_now = { + status = "not present", + perc = "N/A", + time = "N/A", + watt = "N/A" + } + local present = first_line("/sys/class/power_supply/" .. battery .. "/present")