How to find out a window's process ID?

Kevin Krammer kevin.krammer at gmx.at
Mon Dec 8 22:18:27 GMT 2003


On Monday 08 December 2003 18:24, Josep Febrer wrote:
> A Divendres 28 Novembre 2003 07:47, TK va escriure:
> > There are tools to do it on other platforms, but I don't how to do it in
> > KDE, or should I say in XFree86?
>
> To know the PID from the active window you can try something like this:
>
> window=`xprop -root | grep '_NET_ACTIVE_WINDOW(WINDOW)' | awk '{print
> $5;}'` pid=`xprop -id $window | grep NET_WM_PID | awk '{print $3;}'`
>
> Josep

KWin class 
http://developer.kde.org/documentation/library/3.1-api/kdecore/html/classKWin.html
can tell you the PID of the process.
Not sure if this works with remote processes.

Cheers,
Kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde/attachments/20031208/f5ef0193/attachment.sig>
-------------- next part --------------
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


More information about the kde mailing list