How to detect TB window existing from a script

For some reason wmctrl -l doesn’t work in Qubes-Whonix (it does in normal Whonix). It says it can’t list windows.

I need this for a custom script. I need to wait for a Tor Browser window and know that it exists (not just firefox.real process).

Most likely not an issue caused by Whonix but by Qubes due to the way Qubes implements the graphic server.

Most likely unspecific to Whonix.

The same issue is probably reproducible with Tor Browser inside a Debian based App Qube. I.e. without Whonix involved at all. Therefore this issue can be resolved as per:

In other words, wrong place to ask, this needs to be redirected to Qubes.