local qvars = require "quarrel.vars" local wibox = require "wibox" local qmath = require "quarrel.math" local gcolor = require "gears.color" local phosphor = require "assets.phosphor" local wifi = wibox.widget { widget = wibox.container.place, valign = "center", halign = "center", { widget = wibox.widget.imagebox, image = gcolor.recolor_image(phosphor.wifi_x_fill, qvars.colors.red), forced_width = qvars.icon_size, forced_height = qvars.icon_size } } awesome.connect_signal("services::wifi", function(strength, connected) if not connected then wifi.widget.image = gcolor.recolor_image(phosphor.wifi_x_fill, qvars.colors.red) return end local icon_data = qmath.step_value(strength, { { 0, { "none", "red" } }, { 25, { "low", "yellow" } }, { 50, { "medium", "yellow" } }, { 75, { "high", "green" } }, { 100 } }) wifi.widget.image = gcolor.recolor_image(phosphor["wifi_" .. icon_data[1] .. "_fill"], qvars.colors[icon_data[2]]) end) return wifi