ssanthosh243 / semicomplete

Automatically exported from code.google.com/p/semicomplete
0 stars 0 forks source link

Could search on process id #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is more of a feature request than an issue but searching by process id
would be nice.

There is no guarantee a window has the _atomPID property set, nor what
machine the process valid on, if its even running, but its still pretty useful.

Below is a snippet taken from
http://stackoverflow.com/questions/151407/how-to-get-an-x11-window-from-a-proces
s-id

      // Get the PID for the current Window.
      Atom           type;
      int            format;
      unsigned long  nItems;
      unsigned long  bytesAfter;
      unsigned char *propPID = 0;
      if(Success == XGetWindowProperty(_display, w, _atomPID, 0, 1, False,
XA_CARDINAL,
                       &type, &format, &nItems, &bytesAfter, &propPID)) {
    if(propPID != 0) {
      printf(" pid: %ld", *((unsigned long *)propPID));
      XFree(propPID);
    }
      }

Original issue reported on code.google.com by mat...@xtra.co.nz on 12 Sep 2009 at 10:21

GoogleCodeExporter commented 9 years ago
Sounds good.

libxdo/xdotool already do some window property fetching for things like 
NetWM/EWMH 
support, so adding this should be simple.

I'll try to work on it this weekend.

Original comment by jls.semi...@gmail.com on 1 Jan 2010 at 4:01

GoogleCodeExporter commented 9 years ago
Fix checked in as svn r2649.

Usage:
xdotool search --pid 12345

You can search by pid and window title, too:
xdotool search --all --pid 12345 "hello world"

This will appear in the next release, but is available now from svn.

Original comment by jls.semi...@gmail.com on 23 Feb 2010 at 11:51