If a process was created by executing
an X Windows application, is there a way one can
find what is the DISPLAY for this process.
-Kamal
If a process was created by executing
an X Windows application, is there a way one can
find what is the DISPLAY for this process.
-Kamal
: If a process was created by executing
: an X Windows application, is there a way one can
: find what is the DISPLAY for this process.
: -Kamal
Get lsof from the net somewhere. Assuming you know the pid (and you
don't have to, lsof has a rich syntax for drilling down to the data)
the following would work (for most cases) in ksh
lsof -a -p$pid -iTCP:6000 -Fn |
while read data
do
case "$data" in
p*) ;; # ignore
n*) DISPLAY=${data#n*>};DISPLAY=${DISPLAY%:*}:0;break;;
esac
done
# if DISPLAY is unset, must be localhost connecting on UNIX domain socket
: ${DISPLAY:=$(hostname):0}
lsof -a -p$pid -iTCP:6000 -Fn |
| | | |
| | | |
| | | just output pid and netname
| | |
| | all xclients talk to remote servers on port 6000
| |
| PID to examinse
|
AND all conditions
output might be:
p7177
nclienthost.domain.name:1234->serverhost.domain.name:6000
nclienthost.domain.name:5678->serverhost.domain.name:6000
(multiple connections are possible, as with HP-VUE's and CDE's window
managers)
--
Dan Mercer
Opinions expressed herein are my own and may not represent those of my employer.
> If a process was created by executing
> an X Windows application, is there a way one can
> find what is the DISPLAY for this process.
> -Kamal
But if you want to know which X-Server a process is client of, you
can use the XDisplayName().
Michel
1. Finding the DISPLAY associated with a process
If a process was created by executing
an X Windows application, is there a way one can
find what is the DISPLAY for this process.
-Kamal
2. Trouble mounting second partition of first hard drive
3. Find executable associated with a process?
5. Finding process associated with TCP/UDP port...
6. Help! Allocating space on devices
7. Get process ids of all processes associated with a given ip-address
9. Process id's and their associated process names
10. How is it possible to find the display of a running process ?
11. How is it possible to find the display of a running process?
12. Finding the DISPLAY variable for a process.
13. Determining Open Files and Their Associated Processes -- How?