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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
'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.