xlsclients [-display displayname] [-a] [-l] [-m maxcmdlen] [-version]
Xlsclients is a utility for listing information about the client applications running on a display. It may be used to generate scripts representing a snapshot of the user's current session.
X(7), xwininfo(1), xprop(1)
Jim Fulton, MIT X Consortium