Created
August 16, 2014 23:00
-
-
Save syui/ec4976bffefca1c745d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function au(){ | |
case $1 in | |
-o|*) | |
SwitchAudioSource -a | grep output | cut -d '(' -f 1 | sed -e 's/ *$//' -e 's/$/"/g' -e 's/^/"/g' | peco | xargs -J % SwitchAudioSource -s % | |
;; | |
-i) | |
SwitchAudioSource -a | grep input | cut -d '(' -f 1 | sed -e 's/ *$//' -e 's/$/"/g' -e 's/^/"/g' | peco | xargs -J % SwitchAudioSource -t input -s % | |
;; | |
esac | |
#zle reset-prompt | |
} | |
zle -N au | |
bindkey '\^^' au |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment