Skip to content

Instantly share code, notes, and snippets.

@aVolpe
Last active January 8, 2024 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aVolpe/a47737f1e3427f37669a16ea2643fe48 to your computer and use it in GitHub Desktop.
Save aVolpe/a47737f1e3427f37669a16ea2643fe48 to your computer and use it in GitHub Desktop.
fzf SwitchAudioSource
foutput() {
# usage:
# foutput # to open picker
# foutput speakers # to select speakers
device="$(SwitchAudioSource -a -t output |\
fzf-tmux --height=8 --cycle --no-mouse --no-multi --query=$1 -1 |\
cut -f1 -d'(' | xargs)"
SwitchAudioSource -s "$device"
}
finput() {
# usage:
# finput # to open picker
# finput speakers # to select speakers
device="$(SwitchAudioSource -a -t input |\
fzf-tmux --height=8 --cycle --no-mouse --no-multi --query=$1 -1 |\
cut -f1 -d'(' | xargs)"
SwitchAudioSource -t input -s "$device"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment