config/modules/nixos/hardware/audio/dump-ports.lua

29 lines
480 B
Lua
Raw Normal View History

2025-03-22 16:03:07 -04:00
-- Dump all Wireplumber ports
function dump(o)
if type(o) == "table" then
local s = "{ "
for k, v in pairs(o) do
if type(k) ~= "number" then
k = '"' .. k .. '"'
end
s = s .. "[" .. k .. "] = " .. dump(v) .. ",\n"
end
return s .. "} "
else
return tostring(o)
end
end
local port_om = ObjectManager({
Interest({
type = "port",
}),
})
port_om:connect("object-added", function(om, port)
print(dump(port.properties) .. "\n\n")
end)
port_om:activate()