Yessiest
1 year ago
15 changed files with 155 additions and 62 deletions
-
2desktop.conf
-
13libs/builder.lua
-
29libs/digger.lua
-
16themes/reno98/config/root_menu.json
-
14themes/serenity/config/root_menu.json
-
16themes/unity/config/root_menu.json
-
16themes/unity_mate/config/root_menu.json
-
45widgets/clientmenu.lua
-
2widgets/clientmenu/volume.lua
-
5widgets/desktop/battery.lua
-
6widgets/desktop/notifications.lua
-
2widgets/desktop/volume.lua
-
3widgets/dismal.lua
-
45widgets/rootmenu.lua
-
3widgets/xdgmenu.lua
@ -0,0 +1,29 @@ |
|||
-- Since it would seem that get_widget_by_id is still an open issue (https://github.com/awesomeWM/awesome/issues/2945, https://github.com/awesomeWM/awesome/issues/2181), this abomination is the nuclear solution to finding **ALL** widgets that don't get indexed because they are separated by an already instantiated widget. If you use this, please, use it carefully. Don't call it more than you really need, cache the results if you have to. |
|||
-- Hypothetically, if there occurs such a thing as widget cycle, this will get stuck. Also it's very expensive. |
|||
return function(widget, id) |
|||
local results = {} |
|||
local checked = {} |
|||
local function walker(widget, id) |
|||
if widget.children then |
|||
for _,v in pairs(widget:get_children()) do |
|||
if (v.id == id) and (not checked[v]) then |
|||
table.insert(results, v) |
|||
checked[v] = true |
|||
end |
|||
if (v._private.by_id and v._private.by_id[id]) then |
|||
for _,v2 in pairs(v._private.by_id[id]) do |
|||
if not checked[v2] then |
|||
table.insert(results,v2) |
|||
checked[v2] = true |
|||
end |
|||
end |
|||
end |
|||
walker(v, id) |
|||
end |
|||
end |
|||
end |
|||
walker(widget, id) |
|||
return results |
|||
end |
|||
|
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue