It often happens to me, that an application pops up a question and I wonder to which exact application this window belongs, because if I look in the Launcher there is no application that currently has focus (no white triangle on the right side of the icon when I focus the message window)
Is there a way to find out the belonging of an open window?
Using xdotool
First make sure
xdotool
is available on your system:The following command will print the process name of the window currently in focus:
To give yourself more time to focus the window / click on it you can prepend a small sleep duration:
The process name should be displayed after a short amount of time.
Using wininfo
Wininfo is a graphical utility that displays various information on windows and their properties, including the PID (process ID) associated with the window:
wininfo
should be available in the official repositories:Having determined the PID of the window you can then look up the process name associated with it. There are various ways to do this, e.g. by looking at
/proc
:This would be the process name associated with the PID
17002
.A more elegant way that allows inspecting the process tree context, as suggested by @Rmano:
Of course you can also combine
pstree
with thexdotool
option above (thanks to @rubo77 for pointing this out!):Sources:
https://unix.stackexchange.com/q/38867/29245
http://www.linuxquestions.org/questions/debian-26/how-to-find-the-process-associated-with-a-top-level-x-window-907125/
https://superuser.com/q/632979/170160
You can create a keyboard-shortcut with this command:
You can use
xprop
to get the Process ID of the clicked Window:then analyze it with
pstree
:This you can redirected to a text-info window with
I tried to create a keyboard-shortcut for this last command (if you need it regularely), but for some reason This doesn't work.
With xdtool and yad installed you can have a nice GUI App.