I saw this post here and wanted to know if there's any way to also implement the same idea - getting Window ID from PID in Wayland (or preferably, something that is protocol agnostic). X has xdotool and various other tools (e.g. xwininfo, xprop, wlmctrl) to handle this, but there is no current alternative that can do this on Wayland or both X/Wayland.
proc/PID/environ looks promising, but the fact that it is a bit finicky with the permissions makes it impractical.
If anyone has any other ideas or has done this already, that would be great. Thanks!