N0PasteRecent pastes

Description

Switch between two pulseaudio devices
Syntax:
Created: 01.12.2018 | Expires: Never | Hits: 171
Show line NumbersSelect allDownload as text fileParsed in 0.081 seconds
#!/bin/bash
# Switch PulseAudio ouput device
DEFAULT=$(pacmd list-sinks|grep "*"|awk '{ print $3 }')
 
if [ "$DEFAULT" -eq 1 ]; then
    DEV=0
else
    DEV=1
fi
 
pacmd set-default-sink "$DEV" > /dev/null
# change audio output device on running programs
pacmd list-sink-inputs | grep index | while read line
do
    pacmd move-sink-input "$(echo "$line" | cut -f2 -d' ')" "$DEV" > /dev/null
done