dots/.config/awesome/ui/statusbar/panel/widgets/wifi.lua
delta f42a3a2cc9 major update of awesome config
add new icons, switch over to using stylesheets instead of gears.color.recolor_image, add a music widget to the panel, optimize services in common.lua, fix the application lense filtering and increase the update rate of services in common.lua

Signed-off-by: delta <darkussdelta@gmail.com>
2023-05-21 10:12:46 +02:00

43 lines
1.2 KiB
Lua

local phosphor = require "assets.phosphor"
local qui = require "quarrel.ui"
local qvars = require "quarrel.vars"
local wibox = require "wibox"
local wifi = wibox.widget(qui.styled {
widget = wibox.container.background,
{
widget = wibox.container.margin,
margins = qvars.big_padding,
{
{
widget = wibox.container.place,
valign = "center",
halign = "center",
qui.icon(phosphor.wifi_x_fill, qvars.colors.red, { id = "icon" })
},
{
widget = wibox.widget.textbox,
text = "Disconnected",
id = "essid"
},
layout = wibox.layout.fixed.horizontal,
spacing = qvars.padding
}
}
})
awesome.connect_signal("services::wifi", function(essid, _, connected)
if connected then
wifi:get_children_by_id("essid")[1].text = essid
else
wifi:get_children_by_id("essid")[1].text = "Disconnected"
end
end)
awesome.connect_signal("services::wifi::icon", function(icon, color)
wifi:get_children_by_id("icon")[1].image = icon
wifi:get_children_by_id("icon")[1].stylesheet = qui.recolor(color)
end)
return wifi