You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
913 B
32 lines
913 B
#!/bin/bash
|
|
|
|
#Device name variable
|
|
case $1 in
|
|
dac )
|
|
devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo"
|
|
;;
|
|
dac2 )
|
|
devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo"
|
|
;;
|
|
line-out )
|
|
# devicename="alsa_output.pci-0000_00_14.2.analog-stereo"
|
|
devicename="alsa_output.pci-0000_00_14.2.iec958-stereo"
|
|
;;
|
|
esac
|
|
# if [ "$1" = "dac" ]; then
|
|
# devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo"
|
|
# elif [ "$1" = "dac2" ]; then
|
|
# devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo"
|
|
# elif [ "$1" = "line-out" ]; then
|
|
# devicename="alsa_output.pci-0000_00_14.2.analog-stereo"
|
|
# fi
|
|
echo "$devicename"
|
|
|
|
#change the default sink
|
|
pacmd "set-default-sink $devicename"
|
|
|
|
#move all inputs to the new sink
|
|
for app in $(pacmd list-sink-inputs | sed -n -e 's/index:[[:space:]]\([[:digit:]]\)/\1/p');
|
|
do
|
|
pacmd "move-sink-input $app $devicename"
|
|
done
|