lee <l...@yun.yagibdah.de> writes: > Hi, > > I would like to make a function that suspends the corresponding process > when I iconify a window and unsuspends it when I uniconify the window. > > Particularly, I want to (un-)suspend seamonkey with this (because it > uses ridiculous amounts of CPU time and memory the latter of which might > be swapped out more easily when the process is suspended than when it is > not). > > The kill command works nicely for it, i. e. 'kill -STOP <PID of > process>' and 'kill -CONT <PID of process>' work fine. > > I googled for a solution and found some suggestions as to obtain the > process ID, yet none of them seemed to work. Since seamonkey is usually > started through fvwm with a starter function, I might be able to obtain > the PID when starting it and use that. However, this approach would be > somewhat limited.
X windows don't have an associated PID, after all, the window might be from a remote system. For your case, pgrep might give you the PID. -- Dan Espen