From e662552d66cd7786259e26000a107c7e9f49a984 Mon Sep 17 00:00:00 2001 From: Luke Bonham Date: Mon, 13 Jun 2016 09:10:24 +0200 Subject: [PATCH] lain: new commit --- lain | 2 +- rc.lua.blackburn | 6 ------ rc.lua.copland | 25 ++++++++++--------------- rc.lua.dremora | 6 ------ rc.lua.holo | 7 ++----- rc.lua.multicolor | 7 +++---- rc.lua.powerarrow-darker | 2 +- rc.lua.steamburn | 2 +- 8 files changed, 18 insertions(+), 39 deletions(-) diff --git a/lain b/lain index f769402..610bc19 160000 --- a/lain +++ b/lain @@ -1 +1 @@ -Subproject commit f76940230a854482a2ff3715fd2427eba206e68d +Subproject commit 610bc1991a424c9f1ac550c1748ce9b41ce023e0 diff --git a/rc.lua.blackburn b/rc.lua.blackburn index 8d1c25f..dc12747 100644 --- a/rc.lua.blackburn +++ b/rc.lua.blackburn @@ -171,12 +171,6 @@ batwidget = lain.widgets.bat({ settings = function() bat_header = " Bat " bat_p = bat_now.perc .. " " - - if bat_now.status == "Not present" then - bat_header = "" - bat_p = "" - end - widget:set_markup(markup(gray, bat_header) .. bat_p) end }) diff --git a/rc.lua.copland b/rc.lua.copland index 1014c52..0452200 100644 --- a/rc.lua.copland +++ b/rc.lua.copland @@ -180,31 +180,26 @@ batmargin:set_top(6) batmargin:set_bottom(6) batupd = lain.widgets.bat({ settings = function() - if bat_now.perc == "N/A" or bat_now.status == "Not present" then - bat_perc = 100 - baticon:set_image(beautiful.ac) - elseif bat_now.status == "Charging" then - bat_perc = tonumber(bat_now.perc) - baticon:set_image(beautiful.ac) + if bat_now.status == "N/A" then return end - if bat_perc >= 98 then + if bat_now.status == "Charging" then + baticon:set_image(beautiful.ac) + if bat_now.perc >= 98 then batbar:set_color(green) - elseif bat_perc > 50 then + elseif bat_now.perc > 50 then batbar:set_color(beautiful.fg_normal) - elseif bat_perc > 15 then + elseif bat_now.perc > 15 then batbar:set_color(beautiful.fg_normal) else batbar:set_color(red) end else - bat_perc = tonumber(bat_now.perc) - - if bat_perc >= 98 then + if bat_now.perc >= 98 then batbar:set_color(green) - elseif bat_perc > 50 then + elseif bat_now.perc > 50 then batbar:set_color(beautiful.fg_normal) baticon:set_image(beautiful.bat) - elseif bat_perc > 15 then + elseif bat_now.perc > 15 then batbar:set_color(beautiful.fg_normal) baticon:set_image(beautiful.bat_low) else @@ -212,7 +207,7 @@ batupd = lain.widgets.bat({ baticon:set_image(beautiful.bat_no) end end - batbar:set_value(bat_perc / 100) + batbar:set_value(bat_now.perc / 100) end }) batwidget = wibox.widget.background(batmargin) diff --git a/rc.lua.dremora b/rc.lua.dremora index b27cde8..6d03b34 100644 --- a/rc.lua.dremora +++ b/rc.lua.dremora @@ -175,12 +175,6 @@ batwidget = lain.widgets.bat({ settings = function() bat_header = " Bat " bat_p = bat_now.perc .. " " - - if bat_now.status == "Not present" then - bat_header = "" - bat_p = "" - end - widget:set_markup(markup(gray, bat_header) .. markup(white, bat_p)) end }) diff --git a/rc.lua.holo b/rc.lua.holo index 4d05bcd..3380798 100644 --- a/rc.lua.holo +++ b/rc.lua.holo @@ -221,12 +221,9 @@ batwidget = lain.widgets.bat({ settings = function() bat_header = " Bat " bat_p = bat_now.perc .. " " - - if bat_now.status == "Not present" then - bat_header = "" - bat_p = "" + if bat_now.ac_status == 1 then + bat_p = bat_p .. "Plugged " end - widget:set_markup(markup(blue, bat_header) .. bat_p) end }) diff --git a/rc.lua.multicolor b/rc.lua.multicolor index c0e8e65..2da981c 100644 --- a/rc.lua.multicolor +++ b/rc.lua.multicolor @@ -191,10 +191,9 @@ tempwidget = lain.widgets.temp({ baticon = wibox.widget.imagebox(beautiful.widget_batt) batwidget = lain.widgets.bat({ settings = function() - if bat_now.perc == "N/A" then - perc = "AC " - else - perc = bat_now.perc .. "% " + perc = bat_now.perc .. "% " + if bat_now.ac_status == 1 then + perc = perc .. "Plug " end widget:set_text(perc) end diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index 6157a4b..022b10c 100644 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -203,7 +203,7 @@ fswidget = lain.widgets.fs({ baticon = wibox.widget.imagebox(beautiful.widget_battery) batwidget = lain.widgets.bat({ settings = function() - if bat_now.perc == "N/A" then + if bat_now.ac_status == 1 then widget:set_markup(" AC ") baticon:set_image(beautiful.widget_ac) return diff --git a/rc.lua.steamburn b/rc.lua.steamburn index 121ad08..5c7a4fa 100644 --- a/rc.lua.steamburn +++ b/rc.lua.steamburn @@ -176,7 +176,7 @@ fshomeupd = lain.widgets.fs({ batwidget = lain.widgets.bat({ settings = function() bat_perc = bat_now.perc - if bat_perc == "N/A" then bat_perc = "Plug" end + if bat_now.ac_status == 1 then bat_perc = "Plug" end widget:set_markup(markup(gray, " Bat ") .. bat_perc .. " ") end })