ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
'xwininfo' gives you some specs but 'xprop' gives you more and including the Process Id. The problem with both is they require you to literally point out the window to use. I wonder if there's a tool that allows for automation since for instance IceWM's "icesh" can do 'icesh -window focus'...
then you should pass the window ID to another call of xprop using the -id option and looking for the string "_NET_WM_PID(CARDINAL)" to obtain the process ID. Maybe a little tricky, but this should address the doubt raised by unSpawn:
Indeed you did not mention the programming language you were deal with, hence the shell was a common guess. Unfortunately, I'm not a C/C++ programmer, so I'm afraid you have to wait for someone more experienced in this topic. In the meanwhile a good starting point could be to look at the source code of the commands mentioned above. You will find them all at x.org.
I should write a simple java program to pause, resume and kill the process easily by GUI.
@colucix I will get the window id informations from xprop by grapping the window. After that i need to find the process id with these informations but i don't know how. Can you please write me a command which gets window id as parameter, and returns the process id. But this should work for chrome browser which start each tab as a new proces.