A macOS menu bar application that detects AirPods button presses and toggles system-wide microphone mute.
- AirPods Max (crown button)
- AirPods Pro (stem press)
- Button Detection: Press on AirPods toggles microphone mute
- Menu Bar Integration: Shows headphones icon with colored mic badge (green = unmuted, red = muted)
- Visual Feedback: Popover appears briefly when mute state changes
- Connection Status: View AirPods connection state in the menu
- Light/Dark Mode: Icon adapts to menu bar appearance
- Restore on Quit: Microphone is restored to unmuted when app exits
- macOS 14.0+ (Sonoma)
- Xcode 15.0+
- AirPods Max or AirPods Pro (paired via Bluetooth)
PodsMute/
├── App/
│ ├── PodsMuteApp.swift # SwiftUI App entry point
│ ├── AppDelegate.swift # App lifecycle & service wiring
│ └── Info.plist # App configuration
├── UI/
│ └── StatusBarController.swift # Menu bar icon & menu
├── Services/
│ ├── AudioMuteController.swift # Core Audio mute control
│ ├── AudioAccessoryMonitor.swift # Darwin notification listener
│ └── BluetoothManager.swift # Bluetooth connection status
├── Bridge/
│ └── PodsMute-Bridging-Header.h # Bridging header for IOBluetooth
├── Resources/
│ └── Assets.xcassets/ # App icon
└── PodsMute.entitlements
-
Install xcodegen:
brew install xcodegen
-
Generate Xcode project:
xcodegen generate
-
Open in Xcode:
open PodsMute.xcodeproj
-
Build and run (Cmd+R)
- Launch the app (it appears in the menu bar with a headphones icon)
- The app automatically detects your paired AirPods
- Press the crown button (Max) or stem (Pro) to toggle microphone mute
- A popover briefly shows "Microphone On" or "Microphone Off"
- The mic badge on the icon updates:
- Green mic: Unmuted
- Red mic with slash: Muted
- Left-click: Toggle mute
- Right-click: Show menu
- Microphone status
- Toggle Mute (Cmd+M)
- AirPods connection status
- Device name
- Reconnect (Cmd+R)
- About PodsMute
- Quit (Cmd+Q)
The app listens for Darwin notifications from audioaccessoryd, the macOS daemon that handles audio accessory events. When AirPods trigger a mute action, the daemon emits a com.apple.audioaccessoryd.MuteState notification which this app intercepts to toggle the system microphone.
Uses Core Audio HAL APIs:
kAudioHardwarePropertyDefaultInputDevice- Get default mickAudioDevicePropertyMute- Get/set mute state
Uses IOBluetooth to check connection status of paired AirPods devices for display purposes.
- Ensure AirPods are paired in System Settings > Bluetooth
- Connect to them at least once manually
- Restart the app
- Check System Settings > Privacy & Security > Microphone
- Ensure the app has microphone access permission
- Make sure AirPods are connected and set as input device
The icon should automatically adapt when you switch modes. If it doesn't update immediately, toggle the mute state once.
- Protocol research: librepods
MIT License