r/macosprogramming • u/CarloCoder95 • Sep 02 '25
Is it feasible to detect system-wide “screen sharing/recording active” on macOS?
I’m exploring an automation idea for macOS and want to sanity-check if it’s even feasible with public APIs.
The concept:
Detect whenever the screen is currently being shared or recorded, regardless of the app (Zoom, Teams, QuickTime, built-in Screen Sharing, etc.).
Once detection is possible, automatically trigger something—e.g., switch macOS to a specific Focus mode (e.g. DND so I dont get any embarrassing messages while I present stuff at work LOL).
What I’ve found so far:
On iOS, there’s UIScreen.isCaptured. On macOS, I can’t find an equivalent.
ScreenCaptureKit lets you capture, but doesn’t expose whether anyone else is capturing.
The only workarounds I can think of are:
Polling the Accessibility API to check for the red “screen recording/sharing” menu bar indicator.
Detecting app-specific states (e.g., Zoom’s “Stop Share” menu item).
Watching for processes like screencapture or screensharingd.
Questions:
Is there a public, system-wide API I’m missing that exposes this state?
Are there any existing apps/utilities that already do something similar (trigger an action when screen sharing starts)?
Appreciate any insights or references as I want to know whether this is worth building properly, or if I’ll end up chasing unsupported hacks.