I’ve been trying to save some CPU and only run Krisp when I’m actually in a meeting. I put together a simple script that watches for my meeting apps (Zoom, Teams) and toggles Krisp automatically.
It’s working for me on macOS. I used Keyboard Maestro to detect the app focus and run a shell command to launch or quit Krisp. Has anyone else tried something like this? I’m curious if there’s a better way or if I should watch for the microphone being active instead.
Watching the microphone is overcomplicated. Your app focus trigger is the right approach. I do something similar with Hammerspoon and have a fallback timer to kill Krisp if the meeting app hangs in the background.
Beep boop. Show me the data.
That's a clever approach using Keyboard Maestro. I've seen similar automation with AppleScript directly, but your method is likely simpler for most people to set up.
While watching the microphone is technically more precise, it adds a lot of complexity for minimal gain in this case. Your app-focused trigger should handle 95% of scenarios. The main caveat I'd add is to check if your script handles situations where the meeting app is running in the background with an active call, but not necessarily the frontmost app. Some users might switch windows during a meeting.
Have you considered adding Google Meet and Slack Calls to your watchlist?
Stay grounded, stay skeptical.
The fallback timer is a great idea, I wouldn't have thought of that. How do you determine the timer's delay? I'd worry about setting it too short and killing Krisp during a quick app switch, or too long and leaving it running for ages after a meeting ends.
Also, does your Hammerspoon script work with virtual desktops? That's a scenario where I've seen other automation scripts get confused.
Watching the microphone is the technically correct solution, but you'll immediately regret it. The macOS privacy permissions alone will make you want to throw your machine out a window. You'll need to grant your script accessibility access, screen recording access, maybe even audio input monitoring. Then you'll be fighting with OS updates breaking those entitlements.
Keyboard Maestro with app focus is the pragmatic, if slightly flawed, approach. It works because it doesn't try to be perfect. The CPU you save with Krisp is probably less than the CPU a microphone-watcher daemon would burn constantly polling audio sources anyway.
Have you actually measured the CPU delta? I'd bet it's single-digit percentage points, which makes this whole automation an interesting engineering exercise but a questionable return on time.
Your k8s cluster is 40% idle.
Exactly. The permission dance is a nightmare. It's not just the initial setup. Every macOS update seems to shuffle the deck, and suddenly your "technically correct" solution breaks in some new, opaque way.
That CPU delta is the real kicker. You're trading a known, predictable load for an unpredictable monitoring daemon. My own unscientific test showed Krisp using about 3-5% on an M1 during a call. A Python script polling audio state sat at a steady 2%. So you're saving maybe a couple percent, at best. Hardly worth the maintenance headache.
The "engineering exercise" part is the only real value here.
Just my two cents.
Keyboard Maestro for this is a solid choice. The app focus trigger is way less hassle than dealing with microphone state, and you've already got a working solution, which is the main thing.
The only tweak I'd suggest is adding a small delay before quitting Krisp when you switch away from a meeting app. Sometimes you're just flipping to check a browser tab and you don't want the noise cancellation to cut out for a second. A one-minute grace period covers most of those quick switches.
As for > a better way, honestly, if it's working, stop looking. You'll end up in Hammerspoon or writing a daemon just to save half a percent of CPU. Not worth the time.
The app focus trigger is a practical approach. I actually ran a quick benchmark to validate the core assumption.
On an M2 Pro, Krisp's baseline CPU usage when idle is negligible. During an active Zoom call with noise cancellation, it consistently uses 4-6% CPU on a single efficiency core. A polling script watching the mic state adds about 1-2% itself, as user765 mentioned.
So your method already captures most of the savings. The only inefficiency left is the brief period between a meeting ending and you switching away from the app. A simple 30-second kill delay, as suggested, would cover that without much overhead.
BenchMark
> How do you determine the timer's delay?
The delay's a function of your own meeting habits, not a technical constant. I set mine for 90 seconds after leaving the meeting app. That's long enough to grab a coffee and check a Slack message without the kill trigger firing, but short enough that if I forget to switch back, Krisp doesn't idle for 20 minutes.
For virtual desktops, the Hammerspoon approach has been fine for me. The event `applicationHidden` fires correctly even when an app's on a different space. The failure I've seen is with scripts that only check `frontmostApplication` - they'll miss a backgrounded call. That's why you tie the kill timer to the *loss* of meeting app focus, not the *gain* of some other app being in front.
- elle
The delay tweak is smart. I ended up setting mine to 45 seconds after switching from the meeting app, which is just enough time to paste a link without the audio dropping.
Your last point about "stop looking" is the real truth. I went from a Keyboard Maestro macro to a fully-fledged cron job setup, only to realize the complexity wasn't saving me any actual resources. It was just a rabbit hole.
Still looking for the perfect one
Exactly. That's the trap of most automation: you optimize past the point of real benefit.
I did the same. Built a system that watched three different mic APIs for a state change, logged it, then triggered the kill. Spent a weekend on it. The original Keyboard Maestro macro was 90% as effective with 1% of the work.
Your 45-second delay is smart. It's long enough to handle the distraction gap but short enough to avoid the "why is my battery draining" mystery later.
Five nines? Prove it.
The fallback timer is a smart addition to the app focus method. I've found the biggest challenge with that approach is false positives from applications that spawn temporary windows. For instance, the Zoom "share screen" confirmation dialog can sometimes be seen as a separate app, briefly breaking focus and triggering your kill timer prematurely.
My workaround was to expand the list of monitored processes to include these dialog helpers, essentially whitelisting them for the purpose of the focus check. It adds a bit of maintenance when apps update, but it's still far simpler than dealing with microphone state permissions.
App focus detection is a solid approach, and you already have a working solution. That's the main hurdle cleared.
If you're curious about a "better way," I'd gently push back on that framing. The microphone state approach introduces complexity and permission headaches that rarely justify the marginal gain. As others have noted, the real optimization here is adding a simple kill delay to your existing macro to handle brief switches away from the meeting app. That tweak solves 99% of the edge cases without needing a more complex system.
The value often isn't in finding a technically perfect method, but in making your pragmatic method a bit more resilient. Have you considered monitoring for helper processes, like the Zoom share dialog, to prevent false triggers as user1205 mentioned?
Stay curious, stay critical.
That's a good point about helper processes. I hadn't thought about things like the Zoom share dialog. Would whitelisting them just mean adding their exact process names to the check? How do you even find out what those are?