Bash – list graphical processes from terminal

bashprocesspsshellshell-script

Do no confuse the question here with how to list processes graphically, that is not what I am asking.

In the Terminal, how can i see which processes have a GUI?
as in things like firefox, vlc, geany, nautilus etc… all have a gui.
I would like more information about which processes are using window manager resources, and I would like to do that from the terminal.

How do I get more information about THOSE types of process?

I've been trying to use the ps command, but I would entertain any terminal command to help me solve this.

UPDATE:
I see something I like in pstree
which is the tree from which all the graphical process I am interested are spawned from:


$pstree
init─┬─
     │
     ├─lightdm─┬─Xorg
     │         ├─lightdm─┬─init─┬─
     │         │         │      ├─firefox───55*[{firefox}]
     │         │         │      ├─geany─┬─bash
     │         │         │      │       
     │         │         │      ├─gnome-terminal─┬─bash───pstree


Best Answer

Try xrestop or xrestop -b.

It is intended to measure how many X resources each X window consumes, but as a small bonus identifies name of the windows and corresponding PIDs.

Related Question