Created
April 23, 2019 22:43
-
-
Save rpxio/bc72b377047da917200f005dba81e8d9 to your computer and use it in GitHub Desktop.
audio toggle
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
#!/bin/bash | |
new_sink=$(pacmd list-sinks | grep index | tee /dev/stdout | grep -m1 -A1 "* index" | tail -1 | cut -c12-) | |
echo "Setting default sink to: $new_sink"; | |
pacmd set-default-sink $new_sink | |
pacmd list-sink-inputs | grep index | while read line | |
do | |
echo "Moving input: "; | |
echo $line | cut -f2 -d' '; | |
echo "to sink: $new_sink"; | |
pacmd move-sink-input `echo $line | cut -f2 -d' '` $new_sink | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment