mirror of
https://github.com/don-philipe/knorke.git
synced 2026-05-13 23:31:46 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1404159cc4 | |||
| 5ee82345ed |
+60
@@ -0,0 +1,60 @@
|
|||||||
|
local awful = require("awful")
|
||||||
|
local beautiful = require("beautiful")
|
||||||
|
local gears = require("gears")
|
||||||
|
local vicious = require("vicious")
|
||||||
|
local wibox = require("wibox")
|
||||||
|
|
||||||
|
local color = beautiful.bg_focus
|
||||||
|
|
||||||
|
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,
|
||||||
|
resize = true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id = "text",
|
||||||
|
widget = wibox.widget.textbox,
|
||||||
|
resize = true,
|
||||||
|
forced_width = 30,
|
||||||
|
align = "right"
|
||||||
|
},
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
}
|
||||||
|
local container = wibox.container.margin(wibox.container.margin(widget, 3), 3)
|
||||||
|
local pkgs = ""
|
||||||
|
|
||||||
|
vicious.register(widget.text, vicious.widgets.pkg,
|
||||||
|
function (w, args)
|
||||||
|
pkgs = args[2]
|
||||||
|
return args[1]
|
||||||
|
end, 5, "Arch")
|
||||||
|
|
||||||
|
-- These icons should come as beautiful.icons
|
||||||
|
function container.set_icons(pacman)
|
||||||
|
widget.icon:set_image(pacman)
|
||||||
|
end
|
||||||
|
|
||||||
|
awful.tooltip(
|
||||||
|
{
|
||||||
|
objects = { widget },
|
||||||
|
mode = "outside",
|
||||||
|
align = "right",
|
||||||
|
fg = "white",
|
||||||
|
margin_leftright = 10,
|
||||||
|
margin_topbottom = 10,
|
||||||
|
timer_function = function()
|
||||||
|
return "Installable packages: \n" .. pkgs
|
||||||
|
end,
|
||||||
|
preferred_positions = {"right", "left", "top", "bottom"}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
return container
|
||||||
@@ -50,7 +50,7 @@ vicious.register(widget.text, vicious.widgets.wifi,
|
|||||||
end
|
end
|
||||||
info = args
|
info = args
|
||||||
else
|
else
|
||||||
widget.icon:set_image(icon_wifi)
|
widget.icon:set_image(icon_none)
|
||||||
end
|
end
|
||||||
return " " .. args["{ssid}"]
|
return " " .. args["{ssid}"]
|
||||||
end, 2, "wlp64s0")
|
end, 2, "wlp64s0")
|
||||||
@@ -73,7 +73,11 @@ awful.tooltip(
|
|||||||
margin_leftright = 10,
|
margin_leftright = 10,
|
||||||
margin_topbottom = 10,
|
margin_topbottom = 10,
|
||||||
timer_function = function()
|
timer_function = function()
|
||||||
|
if info["{ssid}"] ~= nil then
|
||||||
return info["{ssid}"] .. "\n Channel: " .. info["{chan}"] .. "\n Rate: " .. info["{rate}"] .. "Mb/s\n Frequency: " .. info["{freq}"] .. "MHz"
|
return info["{ssid}"] .. "\n Channel: " .. info["{chan}"] .. "\n Rate: " .. info["{rate}"] .. "Mb/s\n Frequency: " .. info["{freq}"] .. "MHz"
|
||||||
|
else
|
||||||
|
return "N/A"
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
preferred_positions = {"right", "left", "top", "bottom"}
|
preferred_positions = {"right", "left", "top", "bottom"}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user