1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-10-22 20:41:22 +00:00

fix error when bat value is nil

This commit is contained in:
maben 2016-12-30 16:49:48 +08:00
parent 4495f07b4e
commit f83f100ca5

View file

@ -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)