[i3-discuss] SIGSTOP a process when unfocused

  • From: Derek Potts <derek@xxxxxxxxxxxxx>
  • To: i3-discuss@xxxxxxxxxxxxx
  • Date: Fri, 12 Feb 2016 12:52:55 -0600

I would like to send a SIGSTOP to a particular process when its window
looses focus. My scenario is that I run a cpu-intensive process that does
not need to be active when I am not looking at it. It is rather expensive
to startup, so SIGSTOP and SIGCONT turn out to be a good solution. I always
run it on a predictable workspace, so I have bound a key to send it a
SIGCONT and and switch to that workspace. That works very well for popping
over to it to take a look at it. What I would like to accomplish is to send
it a SIGSTOP anytime that I move away from it. I don't run any other
processes in that workspace, so it would work equally well to SIGSTOP it
when I move away from that particular workspace. Can this be accomplished?

Other related posts: