├── .gitignore ├── icon.png ├── E47C1DA3-417C-479F-B8AC-C4294927395C.png ├── README.md └── info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | change_shound_output.alfredworkflow 2 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drselump14/alfred-change-sound-output/HEAD/icon.png -------------------------------------------------------------------------------- /E47C1DA3-417C-479F-B8AC-C4294927395C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drselump14/alfred-change-sound-output/HEAD/E47C1DA3-417C-479F-B8AC-C4294927395C.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## alfred-change-sound-output 2 | 3 | Change your sound output using alfred!! 4 | 5 | # Requirements: 6 | - [jq](https://github.com/stedolan/jq) ( `brew install jq` ) 7 | - [SwitchAudioSource](https://github.com/deweller/switchaudio-osx) ( `brew install switchaudio-osx` ) 8 | - [terminal-notifier](https://github.com/julienXX/terminal-notifier) ( `brew install terminal-notifier` ) 9 | 10 | # Build: 11 | 12 | cd alfred-change-sound-output 13 | zip change_shound_output.alfredworkflow * 14 | open change_shound_output.alfredworkflow 15 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.cakmet14.change_sound 7 | category 8 | Tools 9 | connections 10 | 11 | 38163BFB-14BA-4071-AF24-633928D9B5C3 12 | 13 | E47C1DA3-417C-479F-B8AC-C4294927395C 14 | 15 | 16 | destinationuid 17 | 38163BFB-14BA-4071-AF24-633928D9B5C3 18 | modifiers 19 | 0 20 | modifiersubtext 21 | 22 | vitoclose 23 | 24 | 25 | 26 | 27 | createdby 28 | cak met 29 | description 30 | 31 | disabled 32 | 33 | name 34 | change sound 35 | objects 36 | 37 | 38 | config 39 | 40 | alfredfiltersresults 41 | 42 | argumenttype 43 | 2 44 | escaping 45 | 102 46 | keyword 47 | output 48 | queuedelaycustom 49 | 3 50 | queuedelayimmediatelyinitially 51 | 52 | queuedelaymode 53 | 0 54 | queuemode 55 | 2 56 | runningsubtext 57 | 58 | script 59 | query=$1 60 | export PATH="/usr/local/bin:$PATH" 61 | /usr/local/bin/SwitchAudioSource -a -t output| jq -R -s 'split("\n") | map(select(length>0)) | map({"title": ., "arg": ., "icon": { "path": "./icon.png"} } )' | jq -s '{ "items": .[] }' 62 | scriptargtype 63 | 1 64 | scriptfile 65 | 66 | subtext 67 | 68 | title 69 | change sound output 70 | type 71 | 0 72 | withspace 73 | 74 | 75 | type 76 | alfred.workflow.input.scriptfilter 77 | uid 78 | E47C1DA3-417C-479F-B8AC-C4294927395C 79 | version 80 | 2 81 | 82 | 83 | config 84 | 85 | concurrently 86 | 87 | escaping 88 | 102 89 | script 90 | export PATH="/usr/local/bin:$PATH" 91 | query=`echo "{query}" | awk '{gsub(/.\(output\)/,"");}1' | sed 's/(\s)+$//'` 92 | SwitchAudioSource -s "$query" 93 | sleep 1 94 | say $query & 95 | terminal-notifier \ 96 | -message "Change sound output to $query" \ 97 | -appIcon ./icon.png \ 98 | -sender com.runningwithcrayons.Alfred-3 \ 99 | -title "Alfred" 100 | scriptargtype 101 | 0 102 | scriptfile 103 | 104 | type 105 | 0 106 | 107 | type 108 | alfred.workflow.action.script 109 | uid 110 | 38163BFB-14BA-4071-AF24-633928D9B5C3 111 | version 112 | 2 113 | 114 | 115 | readme 116 | 117 | uidata 118 | 119 | 38163BFB-14BA-4071-AF24-633928D9B5C3 120 | 121 | xpos 122 | 520 123 | ypos 124 | 250 125 | 126 | E47C1DA3-417C-479F-B8AC-C4294927395C 127 | 128 | xpos 129 | 270 130 | ypos 131 | 250 132 | 133 | 134 | webaddress 135 | 136 | 137 | 138 | --------------------------------------------------------------------------------