I was just reading »How to revert to GNOME Classic?«. Some answers say that you should press Alt+Win to get the Add to panel dialogue. However my keyboard has no Win. So I was asking myself how to start the Add to panel window. Usually the best way is to enter the program name into a terminal. In this case I can't figure out the name.
I tested it on another computer and couldn't find the name in the process list. Also xwininfo
or similar programs shoed no name. So what is the best way to figure out the name of the program which opened a (X) window.
Running
xprop _NET_WM_PID
from a terminal will put X into a special mode where you can click on a window to get that window's PID in the terminal.Then run
ls -l /proc/<pid>/exe
and look at where the link is to to figure out what the program's file name is.The following is a little python script take from a program I'm working on:
Save this into a file and run by typing
python <filename>.py
. Click on the window and it will print the program's name.Based on iBelieve's answer:
The
$NF
in the awk commands must be escaped so it's not interpreted as a shell variable. As soon as you run it a reticle will appear for you to click on the desired window.