1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
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
|