From 32748794119556b4da59430cd5ca9451780979f1 Mon Sep 17 00:00:00 2001 From: Luke Bonham Date: Fri, 23 Jun 2017 11:56:47 +0200 Subject: [PATCH] fix battery perc variable; closes #187 --- themes/multicolor/theme.lua | 2 +- themes/steamburn/theme.lua | 6 +++--- themes/vertex/theme.lua | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/multicolor/theme.lua b/themes/multicolor/theme.lua index fff376e..2642a5e 100644 --- a/themes/multicolor/theme.lua +++ b/themes/multicolor/theme.lua @@ -181,7 +181,7 @@ local bat = lain.widget.bat({ perc = perc .. " plug" end - widget:set_markup(markup.fontfg(theme.font, theme.fg_normal, bat_now.perc .. " ")) + widget:set_markup(markup.fontfg(theme.font, theme.fg_normal, perc .. " ")) end }) diff --git a/themes/steamburn/theme.lua b/themes/steamburn/theme.lua index 10309d5..40c7d52 100644 --- a/themes/steamburn/theme.lua +++ b/themes/steamburn/theme.lua @@ -156,9 +156,9 @@ theme.fs = lain.widget.fs({ -- Battery local bat = lain.widget.bat({ settings = function() - bat_perc = bat_now.perc - if bat_now.ac_status == 1 then bat_perc = "Plug" end - widget:set_markup(markup.font(theme.font, markup(gray, " Bat ") .. bat_perc .. " ")) + local perc = bat_now.perc + if bat_now.ac_status == 1 then perc = "Plug" end + widget:set_markup(markup.font(theme.font, markup(gray, " Bat ") .. perc .. " ")) end }) diff --git a/themes/vertex/theme.lua b/themes/vertex/theme.lua index c073454..5746bcd 100644 --- a/themes/vertex/theme.lua +++ b/themes/vertex/theme.lua @@ -157,7 +157,7 @@ local bat = lain.widget.bat({ end baticon:set_image(theme[index]) - battooltip:set_markup(string.format("\n%s%%, %s", bat_now.perc, bat_now.time)) + battooltip:set_markup(string.format("\n%s%%, %s", perc, bat_now.time)) end })