Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/ruby
- # Get the current default sink
- default_sink_index = `pacmd list-sinks | grep "\* index:"`.match(/\d/)[0]
- # Set the sink to use
- new_sink_index = nil
- if default_sink_index == '0'
- new_sink_index = '1'
- elsif default_sink_index == '1'
- new_sink_index = '0'
- end
- STDOUT.puts "Going to sink: #{new_sink_index}"
- # Use the shellscript to make the change for us
- # From http://askubuntu.com/questions/71863/how-to-change-pulseaudio-sink-with-pacmd-set-default-sink-during-playback
- `movesinks.sh #{new_sink_index}`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement