mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2024-12-23 03:32:30 +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()
|
settings = function()
|
||||||
bat_header = " Bat "
|
bat_header = " Bat "
|
||||||
bat_p = bat_now.perc .. " "
|
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)
|
widget:set_markup(markup(gray, bat_header) .. bat_p)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
|
@ -180,31 +180,26 @@ batmargin:set_top(6)
|
||||||
batmargin:set_bottom(6)
|
batmargin:set_bottom(6)
|
||||||
batupd = lain.widgets.bat({
|
batupd = lain.widgets.bat({
|
||||||
settings = function()
|
settings = function()
|
||||||
if bat_now.perc == "N/A" or bat_now.status == "Not present" then
|
if bat_now.status == "N/A" then return end
|
||||||
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_perc >= 98 then
|
if bat_now.status == "Charging" then
|
||||||
|
baticon:set_image(beautiful.ac)
|
||||||
|
if bat_now.perc >= 98 then
|
||||||
batbar:set_color(green)
|
batbar:set_color(green)
|
||||||
elseif bat_perc > 50 then
|
elseif bat_now.perc > 50 then
|
||||||
batbar:set_color(beautiful.fg_normal)
|
batbar:set_color(beautiful.fg_normal)
|
||||||
elseif bat_perc > 15 then
|
elseif bat_now.perc > 15 then
|
||||||
batbar:set_color(beautiful.fg_normal)
|
batbar:set_color(beautiful.fg_normal)
|
||||||
else
|
else
|
||||||
batbar:set_color(red)
|
batbar:set_color(red)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
bat_perc = tonumber(bat_now.perc)
|
if bat_now.perc >= 98 then
|
||||||
|
|
||||||
if bat_perc >= 98 then
|
|
||||||
batbar:set_color(green)
|
batbar:set_color(green)
|
||||||
elseif bat_perc > 50 then
|
elseif bat_now.perc > 50 then
|
||||||
batbar:set_color(beautiful.fg_normal)
|
batbar:set_color(beautiful.fg_normal)
|
||||||
baticon:set_image(beautiful.bat)
|
baticon:set_image(beautiful.bat)
|
||||||
elseif bat_perc > 15 then
|
elseif bat_now.perc > 15 then
|
||||||
batbar:set_color(beautiful.fg_normal)
|
batbar:set_color(beautiful.fg_normal)
|
||||||
baticon:set_image(beautiful.bat_low)
|
baticon:set_image(beautiful.bat_low)
|
||||||
else
|
else
|
||||||
|
@ -212,7 +207,7 @@ batupd = lain.widgets.bat({
|
||||||
baticon:set_image(beautiful.bat_no)
|
baticon:set_image(beautiful.bat_no)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
batbar:set_value(bat_perc / 100)
|
batbar:set_value(bat_now.perc / 100)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
batwidget = wibox.widget.background(batmargin)
|
batwidget = wibox.widget.background(batmargin)
|
||||||
|
|
|
@ -175,12 +175,6 @@ batwidget = lain.widgets.bat({
|
||||||
settings = function()
|
settings = function()
|
||||||
bat_header = " Bat "
|
bat_header = " Bat "
|
||||||
bat_p = bat_now.perc .. " "
|
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))
|
widget:set_markup(markup(gray, bat_header) .. markup(white, bat_p))
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
|
@ -221,12 +221,9 @@ batwidget = lain.widgets.bat({
|
||||||
settings = function()
|
settings = function()
|
||||||
bat_header = " Bat "
|
bat_header = " Bat "
|
||||||
bat_p = bat_now.perc .. " "
|
bat_p = bat_now.perc .. " "
|
||||||
|
if bat_now.ac_status == 1 then
|
||||||
if bat_now.status == "Not present" then
|
bat_p = bat_p .. "Plugged "
|
||||||
bat_header = ""
|
|
||||||
bat_p = ""
|
|
||||||
end
|
end
|
||||||
|
|
||||||
widget:set_markup(markup(blue, bat_header) .. bat_p)
|
widget:set_markup(markup(blue, bat_header) .. bat_p)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
|
@ -191,10 +191,9 @@ tempwidget = lain.widgets.temp({
|
||||||
baticon = wibox.widget.imagebox(beautiful.widget_batt)
|
baticon = wibox.widget.imagebox(beautiful.widget_batt)
|
||||||
batwidget = lain.widgets.bat({
|
batwidget = lain.widgets.bat({
|
||||||
settings = function()
|
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
|
end
|
||||||
widget:set_text(perc)
|
widget:set_text(perc)
|
||||||
end
|
end
|
||||||
|
|
|
@ -203,7 +203,7 @@ fswidget = lain.widgets.fs({
|
||||||
baticon = wibox.widget.imagebox(beautiful.widget_battery)
|
baticon = wibox.widget.imagebox(beautiful.widget_battery)
|
||||||
batwidget = lain.widgets.bat({
|
batwidget = lain.widgets.bat({
|
||||||
settings = function()
|
settings = function()
|
||||||
if bat_now.perc == "N/A" then
|
if bat_now.ac_status == 1 then
|
||||||
widget:set_markup(" AC ")
|
widget:set_markup(" AC ")
|
||||||
baticon:set_image(beautiful.widget_ac)
|
baticon:set_image(beautiful.widget_ac)
|
||||||
return
|
return
|
||||||
|
|
|
@ -176,7 +176,7 @@ fshomeupd = lain.widgets.fs({
|
||||||
batwidget = lain.widgets.bat({
|
batwidget = lain.widgets.bat({
|
||||||
settings = function()
|
settings = function()
|
||||||
bat_perc = bat_now.perc
|
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 .. " ")
|
widget:set_markup(markup(gray, " Bat ") .. bat_perc .. " ")
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue