This question already has an answer here:
- Event based on battery charge level 3 answers
I’m doing some long-running, CPU-intensive work. This means that I am tethered to a power outlet at all times.
What I’d like to do is ask macOS to suspend a particular program when I’m on battery power and resume it when I plug in.
Googling has failed me. Is there any way? I’m a programmer so I don’t mind going low level if necessary.