X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/ed8853a301813394e776c96ee4a276e2420dc593..1129e88960205b9193b0d8b1c9358acd9c8d27b0:/widgets/bat.lua diff --git a/widgets/bat.lua b/widgets/bat.lua index e633e50..9ab0cdc 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -62,9 +62,10 @@ local function worker(args) } bat_now.n_status = {} + bat_now.n_perc = {} for i = 1, #batteries do bat_now.n_status[i] = "N/A" - bat_now.perc[i] = 0 + bat_now.n_perc[i] = 0 end function update() @@ -98,7 +99,7 @@ local function worker(args) math.floor((energy_now / energy_full) * 100) bat_now.n_status[i] = first_line(bstr .. "/status") or "N/A" - bat_now.perc[i] = energy_percentage or bat_now.perc[i] + bat_now.n_perc[i] = energy_percentage or bat_now.n_perc[i] sum_rate_current = sum_rate_current + (rate_current or 0) sum_rate_voltage = sum_rate_voltage + (rate_voltage or 0)