Last active
August 10, 2022 08:30
-
-
Save Nervengift/844a597104631c36513c to your computer and use it in GitHub Desktop.
Choose pulseaudio sink via rofi/dmenu
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
#!/usr/bin/bash | |
# choose pulseaudio sink via rofi or dmenu | |
# changes default sink and moves all streams to that sink | |
sink=$(ponymix -t sink list|awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}'|rofi -dmenu -p 'pulseaudio sink:' -location 6 -width 100|grep -Po '[0-9]+(?=:)') && | |
# alternate version using dmenu: | |
# sink=$(ponymix -t sink list|awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}'|dmenu -p 'pulseaudio sink:'|grep -Po '[0-9]+(?=:)') && | |
ponymix set-default -d $sink && | |
for input in $(ponymix list -t sink-input|grep -Po '[0-9]+(?=:)');do | |
echo "$input -> $sink" | |
ponymix -t sink-input -d $input move $sink | |
done |
What is the license of this code? Can I create a package out of it?
Sure, use is however you want. Haven't used this in a while myself, so no guarantees.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
huh, I didn't see that last comment but for reference: this script moves all streams to the selected sink.
To send streams to different outputs, I prefer
pavucontrol
.