Jump to content

SwitchAudio - Yet Another Audio Device Switcher

Recommended Posts

# 🔈 SwitchAudio Alfred Workflow




Yet another audio input/output switching interface for SwitchAudioSource

Tested with Alfred 5 and macOS Monterey.


## Motivation

All the other workflows I tried were incompatible with macOS Monterey, so I
figured it would be easier to just build my own


## Prerequisites

You need to have both SwitchAudioSource and JQ installed on your mac. This is
most easily done via Homebrew:


brew install switchaudio-osx jq


Also you will need Alfred Powerpack. This workflow was tested with Alfred 5 only.


## Installation

Download the workflow from GitHub the latest release page and open it :)


## Usage

In Alfred type

;so — to switch output device

;si — to switch input device


## Screenshots

Output selection


output selection


Input selection


input selection

Link to comment
  • 1 month later...
  • 6 months later...
  • 8 months later...

My audio sources were a mess and I was looking for a way to clean this list up and have only the relevant audio sources I really use often. I've updated the code in the workflow like so in the "Script Filter" maybe it helps someone who is looking for something similar.


Below the code where DELL U2518D and DELL U2515H are the names of audio sources I never use


// Orignal 
SwitchAudioSource -a -t output -f json | sed s/\"name\"/\"title\"/ | sed s/\"id\"/\"arg\"/ | jq -s . | jq -n '{ "items": input }'

// Updated
SwitchAudioSource -a -t output -f json | sed 's/"name"/"title"/' | sed 's/"id"/"arg"/' | jq -s '[.[] | select(.title | test("DELL U2518D|DELL U2515H") | not)]' | jq -n '{ "items": input }'


Thanks for the workflow!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...