Skip to content

nikitakatchik/ezmic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ezmic

A tiny headless macOS daemon that keeps your microphone on the right device, automatically, so you stop fiddling with Sound settings.

Rules

  1. Prefer a wired external mic (USB, Thunderbolt, …).
  2. Otherwise the built-in mic — unless the laptop lid is closed (a muffled clamshell mic is worse than a headset), in which case it's demoted.
  3. Bluetooth only as a last resort — never chosen while anything else is available.
  4. A manual pick wins. If you select an input yourself, ezmic pins that device and stops touching the setting until it disconnects.

It's event-driven via CoreAudio — no UI scripting, no polling for devices — and needs no Microphone and no Accessibility permission: it sets the default device, it never records. The whole thing is ~350 lines of Swift you can read.

Install (Homebrew)

brew install nikitakatchik/tap/ezmic
brew services start ezmic

That's it — it now runs in the background and starts at login. No Gatekeeper prompt (Homebrew builds it locally), no scary permissions.

Update / uninstall:

brew upgrade ezmic
brew services stop ezmic && brew uninstall ezmic

Without Homebrew

git clone https://github.com/nikitakatchik/ezmic
cd ezmic
swiftc -O -o ezmic ezmic.swift
./ezmic --status      # try it; --once to apply once

(For an always-on background service, Homebrew is the easy path; otherwise wrap the binary in your own launchd agent.)

Commands

ezmic --status   # devices, lid, and what it'd pick (read-only)
ezmic --once     # evaluate and apply once, then exit
ezmic --reset    # forget the manual-override pin

Logs (Homebrew service): $(brew --prefix)/var/log/ezmic.log.

How "manual pick" detection works

The daemon remembers which device it last set. When the default input changes and (a) it wasn't the daemon and (b) no device was just added/removed, that's a genuine human choice — so it gets pinned. A hotplug that makes macOS auto-switch is not treated as a manual pick; the rules win there.

Notes

  • Building requires the Swift toolchain (Xcode Command Line Tools: xcode-select --install).
  • Aggregate / virtual / Continuity (iPhone) inputs are never auto-selected, but are honoured if you pick one manually.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages