A lightweight macOS menu bar app that toggles between two audio device sets (e.g. headset vs. monitor) with a single click or global hotkey.
- Menu bar icon shows active audio profile
- Toggle between two audio device sets (input + output)
- Configurable global hotkey (default: Cmd+Shift+A)
- Separate input/output devices per profile
- Zero dependencies besides SwitchAudioSource
- Single-file Swift app, no Xcode project needed
Install SwitchAudioSource via Homebrew:
brew install switchaudio-osxgit clone https://github.com/Raptus/AudioSwitcher.git
cd AudioSwitcher
swiftc -o AudioSwitcher AudioSwitcher.swift -framework Cocoa -framework Carbon./AudioSwitcher --list-devicesOutput:
Input devices:
MacBook Pro Microphone
Jabra Link 380
PHL 34B2U6603CH
Output devices:
MacBook Pro Speakers
Jabra Link 380
PHL 34B2U6603CH
./AudioSwitcher --initThis creates ~/.config/audioswitcher/config.json with default values.
{
"primaryInput": "Jabra Link 380",
"primaryOutput": "Jabra Link 380",
"secondaryInput": "PHL 34B2U6603CH",
"secondaryOutput": "PHL 34B2U6603CH",
"hotkeyKey": "a",
"hotkeyModifiers": ["cmd", "shift"]
}| Field | Description |
|---|---|
primaryInput |
Input device for profile 1 (e.g. headset microphone) |
primaryOutput |
Output device for profile 1 (e.g. headset speakers) |
secondaryInput |
Input device for profile 2 (e.g. monitor microphone) |
secondaryOutput |
Output device for profile 2 (e.g. monitor speakers) |
hotkeyKey |
Key for the global hotkey (a-z, 0-9, f1-f12) |
hotkeyModifiers |
Modifier keys: cmd, shift, alt/option, ctrl/control |
Tip: Use --list-devices to find the exact device names. They must match exactly.
./AudioSwitcher --config./AudioSwitcherThe menu bar shows:
- Headphones icon when primary profile is active
- Monitor icon when secondary profile is active
Click the icon to see current input/output devices, toggle the profile, or quit.
Press Cmd+Shift+A (or your configured hotkey) anywhere to toggle between profiles.
Create a Launch Agent to start AudioSwitcher automatically:
cat > ~/Library/LaunchAgents/com.audioswitcher.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.audioswitcher</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/AudioSwitcher</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>
EOFReplace /path/to/AudioSwitcher with the actual path to the binary, then load it:
launchctl load ~/Library/LaunchAgents/com.audioswitcher.plistTo remove:
launchctl unload ~/Library/LaunchAgents/com.audioswitcher.plist
rm ~/Library/LaunchAgents/com.audioswitcher.plist| Command | Description |
|---|---|
./AudioSwitcher |
Start the menu bar app |
./AudioSwitcher --list-devices |
List available audio input/output devices |
./AudioSwitcher --init |
Create default config at ~/.config/audioswitcher/config.json |
./AudioSwitcher --config |
Display current configuration |
./AudioSwitcher --help |
Show help |
MIT - see LICENSE.