mirror of
https://github.com/don-philipe/knorke.git
synced 2026-05-13 23:31:46 +02:00
Add slash separator
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
local vicious = require("vicious")
|
||||
local wibox = require("wibox")
|
||||
|
||||
@@ -6,10 +8,18 @@ local icon_excellent
|
||||
local icon_good
|
||||
local icon_ok
|
||||
local icon_none
|
||||
local color = beautiful.bg_focus
|
||||
|
||||
|
||||
-- Create layout with widgets
|
||||
local widget = wibox.widget {
|
||||
{
|
||||
id = "sep",
|
||||
widget = wibox.widget.separator,
|
||||
shape = gears.shape["parallelogram"],
|
||||
color = color,
|
||||
forced_width = 8
|
||||
},
|
||||
{
|
||||
id = "icon",
|
||||
widget = wibox.widget.imagebox,
|
||||
@@ -22,6 +32,8 @@ local widget = wibox.widget {
|
||||
},
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
local container = wibox.container.margin(wibox.container.margin(widget, 3), 3)
|
||||
|
||||
vicious.register(widget.text, vicious.widgets.wifi,
|
||||
function (w, args)
|
||||
if args["{ssid}"] ~= "N/A" then
|
||||
@@ -41,7 +53,7 @@ vicious.register(widget.text, vicious.widgets.wifi,
|
||||
end, 2, "wlp64s0")
|
||||
|
||||
-- Widget function that is available from the outside.
|
||||
function widget.set_icons(wifi, excellent, good, ok, none)
|
||||
function container.set_icons(wifi, excellent, good, ok, none)
|
||||
icon_wifi = wifi
|
||||
icon_excellent = excellent
|
||||
icon_good = good
|
||||
@@ -49,4 +61,6 @@ function widget.set_icons(wifi, excellent, good, ok, none)
|
||||
icon_none = none
|
||||
end
|
||||
|
||||
return widget
|
||||
return container
|
||||
|
||||
-- scan networks via `sudo iw dev wlp64s0 scan | grep SSID:`
|
||||
|
||||
Reference in New Issue
Block a user