X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/e73a70c2ab26caf981d356756d4f83ad8bfbdb5a..e9e2e6ccd594290df2ccf310d3ca4a632e0c882c:/widgets/bat.lua?ds=inline 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")