mirror of
https://github.com/don-philipe/knorke.git
synced 2026-05-13 23:31:46 +02:00
Add wifi info tooltip
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
local awful = require("awful")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
local vicious = require("vicious")
|
local vicious = require("vicious")
|
||||||
@@ -10,6 +11,7 @@ local icon_ok
|
|||||||
local icon_none
|
local icon_none
|
||||||
local color = beautiful.bg_focus
|
local color = beautiful.bg_focus
|
||||||
|
|
||||||
|
local info = {}
|
||||||
|
|
||||||
-- Create layout with widgets
|
-- Create layout with widgets
|
||||||
local widget = wibox.widget {
|
local widget = wibox.widget {
|
||||||
@@ -46,6 +48,7 @@ vicious.register(widget.text, vicious.widgets.wifi,
|
|||||||
else
|
else
|
||||||
widget.icon:set_image(icon_none)
|
widget.icon:set_image(icon_none)
|
||||||
end
|
end
|
||||||
|
info = args
|
||||||
else
|
else
|
||||||
widget.icon:set_image(icon_wifi)
|
widget.icon:set_image(icon_wifi)
|
||||||
end
|
end
|
||||||
@@ -61,6 +64,21 @@ function container.set_icons(wifi, excellent, good, ok, none)
|
|||||||
icon_none = none
|
icon_none = none
|
||||||
end
|
end
|
||||||
|
|
||||||
|
awful.tooltip(
|
||||||
|
{
|
||||||
|
objects = { widget },
|
||||||
|
mode = "outside",
|
||||||
|
align = "right",
|
||||||
|
fg = "white",
|
||||||
|
margin_leftright = 10,
|
||||||
|
margin_topbottom = 10,
|
||||||
|
timer_function = function()
|
||||||
|
return info["{ssid}"] .. "\n Channel: " .. info["{chan}"] .. "\n Rate: " .. info["{rate}"] .. "Mb/s\n Frequency: " .. info["{freq}"] .. "MHz"
|
||||||
|
end,
|
||||||
|
preferred_positions = {"right", "left", "top", "bottom"}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
return container
|
return container
|
||||||
|
|
||||||
-- scan networks via `sudo iw dev wlp64s0 scan | grep SSID:`
|
-- scan networks via `sudo iw dev wlp64s0 scan | grep SSID:`
|
||||||
|
|||||||
Reference in New Issue
Block a user