Re: list of running X11 applications...
Re: list of running X11 applications...
- Subject: Re: list of running X11 applications...
- From: Hugh McIntyre <email@hidden>
- Date: Sat, 5 Jul 2003 21:29:12 -0700 (PDT)
|> John Davidorff Pell wrote:
|> > xlsclients is a great start, but the info I'm looking for isn't there.
|> > xlsclients (for whatever reason) doesn't give me any info about autocutsel
|> > and it doesn't give me any info about the process, just the window info.
|> > I'm specifically looking for PID. Any ideas?
|>
|> Yeah, xlsclients is okay, not great. It certainly has its flaws.
|>
|> "ps" is the only tool I know of that will give you process ID listings.
|> But there's no way to tie that to an X11 client, AFAIK.
Specifically, the X11 server does not know the remote process ID for each
connection. The connection could even be from a remote non-Unix system without
the concept of processes. So the information simply isn't there.
However as well as xlsclients, you can use "xwininfo" (mostly title/icon info)
or "xprop". The latter gives a list of window properties for a given window,
including:
WM_CLIENT_MACHINE(STRING) = hostname running the command
WM_COMMAND(STRING) = the command and arguments to look for in ps.
E.g.: { "command", "arg1", "arg2" }
Be aware that this information is simply what the client told the server and
therefore both the info from xprop and/or the information from PS (for
BSD-derived ps) can change after the command started. And obviously there can
be more than one command with the same name.
However in one of the cases I tried here, the WM_COMMAND does not always exist,
for example for windows other than the applications top level.
Now, despite all of this bad news, if you don't need a general purpose solution
for this and are just trying to communicate between cooperating processes you
control then you can define your own property to use for communication and then
go looking for this elsewhere. Although clearly this is not secure against
malicious people trying to fake out the property.
Hugh.
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.