mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2024-12-22 19:22:32 +00:00
lain: new commit
This commit is contained in:
parent
8da6c57edb
commit
e662552d66
2
lain
2
lain
|
@ -1 +1 @@
|
|||
Subproject commit f76940230a854482a2ff3715fd2427eba206e68d
|
||||
Subproject commit 610bc1991a424c9f1ac550c1748ce9b41ce023e0
|
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue