Last active
December 11, 2015 23:38
-
-
Save havenwood/4677566 to your computer and use it in GitHub Desktop.
This file contains 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
require "./alfred" | |
results = Alfred::Feedback.new | |
available_outputs = `./SwitchAudioSource -a | grep "(output)" | sed 's/ (output)$//'` | |
current_output = `./SwitchAudioSource -c` | |
def ditch_line available, current | |
available.split("\n").delete_if { |line| line == current }.join("\n") | |
end | |
result = {} | |
result[:title] = result[:uid] = ditch_line available_outputs, current_output | |
result[:subtitle] = current_output | |
result[:arg] = "" | |
results << result | |
puts results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment