I found:
- http://www.refining-linux.org/archives/64/Programmatically-limit-CPU-usage-of-certain-processes/
- Limiting certain processes to CPU % - Linux
but I wonder how to detect which xwindow applications are in background and cpulimit them? Any hint?
That would be useful especially for limiting CPU usage for web browsers that are in background.
My quick and dirty solution: https://gist.github.com/dmgr/08f9dc89095eab4c74b5