Skip to content
anandrajaram21Public

About

Tiny macOS menu bar app that keeps your sound input locked to the mic you choose

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

InputLock icon

InputLock

Keep your Mac's sound input on the mic you picked.

macOS loves switching your input whenever you connect AirPods, plug in headphones, or attach a webcam.
InputLock sits in your menu bar and switches it straight back.

macOS 13+ Swift License: MIT Latest release


⚡ Install

Paste this into Terminal:

curl -fsSL https://raw.githubusercontent.com/anandrajaram21/InputLock/main/install.sh | bash

That's it. InputLock is installed in /Applications, opened, and you'll see a 🎙️ in your menu bar.

Other ways to install

Homebrew

brew tap anandrajaram21/inputlock https://github.com/anandrajaram21/InputLock
brew install --cask inputlock

Manual download

  1. Download InputLock.zip, unzip it, and drag InputLock.app into /Applications.
  2. Open it. macOS will warn that the app isn't from an identified developer (see why).
  3. Go to System Settings → Privacy & Security, scroll down, and click Open Anyway.

Build from source

git clone https://github.com/anandrajaram21/InputLock.git
cd InputLock && ./scripts/build-app.sh
cp -R build/InputLock.app /Applications/

🎛️ How to use

  1. Click the mic icon in your menu bar.
  2. Pick the input device you want to keep.
  3. Done. Whenever something switches your input, InputLock switches it back.
  Keep Sound Input On
  ✓ USB Microphone          (current)
    MacBook Air Microphone
    AirPods Pro
  ───────────────────────
  ✓ Lock Enabled
    Launch at Login
  ───────────────────────
    Quit InputLock      ⌘Q
Menu bar icon Meaning
🎙️ solid mic Locking your chosen device
🚫 mic with a slash Not locking (no device picked, or lock turned off)

Tip

Turn on Launch at Login so InputLock is always running in the background.

✨ Features

  • 🔒 Instant switch-back: reacts the moment the input changes, with no polling
  • 🔌 Survives unplugging: remembers your device and locks it again when you reconnect it
  • 🪶 Tiny and quiet: menu bar only, no Dock icon, ~0% CPU
  • 🙈 No permissions needed: never listens to your mic and makes no network requests
  • 🧑‍💻 ~200 lines of Swift: easy to read and audit

❓ FAQ

Does it record or access my microphone?

No. It only changes which device is the system default input, using the same CoreAudio setting as System Settings → Sound → Input. It never opens an audio stream, so macOS never asks for microphone permission.

What happens if my chosen mic is unplugged?

InputLock leaves your input alone and shows the device as (disconnected) in the menu. When you plug it back in, it becomes the input again automatically.

How do I stop locking temporarily?

Uncheck Lock Enabled in the menu, or click the checked device again to clear your choice.

Why does macOS warn about the app?

Removing that warning requires a paid Apple Developer membership ($99/year) for signing and notarization. InputLock isn't notarized yet. The one-line installer and Homebrew skip the warning because they download the app directly. The source code is all here if you'd like to check it or build it yourself.

🗑️ Uninstall

Quit InputLock from its menu, then:

rm -rf /Applications/InputLock.app
defaults delete io.github.inputlock

Installed with Homebrew? Use brew uninstall --cask --zap inputlock instead.

🛠️ How it works

InputLock registers CoreAudio listeners on kAudioHardwarePropertyDefaultInputDevice and kAudioHardwarePropertyDevices. When either changes and your chosen device is connected but isn't the default input, InputLock sets it as the default again. Devices are stored by their unique ID, so they stay recognized across reconnects and reboots.

File What it does
AudioDevices.swift Lists input devices, gets and sets the default input, and watches for changes
AppDelegate.swift Menu bar UI and switch-back logic
build-app.sh Builds a universal .app bundle

📄 License

MIT. Contributions are welcome!

About

Tiny macOS menu bar app that keeps your sound input locked to the mic you choose

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages