From f83f100ca5c81ceb9e1666d6ae727bda335f6e0b Mon Sep 17 00:00:00 2001 From: maben Date: Fri, 30 Dec 2016 16:49:48 +0800 Subject: [PATCH] fix error when bat value is nil --- rc.lua.powerarrow-darker | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index aa9a8d6..342eff7 100644 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -1,8 +1,8 @@ --[[ - - Powerarrow Darker Awesome WM config 2.0 - github.com/copycat-killer - + + Powerarrow Darker Awesome WM config 2.0 + github.com/copycat-killer + --]] -- {{{ Required libraries @@ -216,9 +216,9 @@ batwidget = lain.widgets.bat({ widget:set_markup(" AC ") baticon:set_image(beautiful.widget_ac) return - elseif tonumber(bat_now.perc) <= 5 then + elseif not bat_now.perc and tonumber(bat_now.perc) <= 5 then baticon:set_image(beautiful.widget_battery_empty) - elseif tonumber(bat_now.perc) <= 15 then + elseif not bat_now.perc and tonumber(bat_now.perc) <= 15 then baticon:set_image(beautiful.widget_battery_low) else baticon:set_image(beautiful.widget_battery)