Dotfiles for my tiling window manager + terminal workflow.
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.

31 lines
853 B

  1. #!/bin/bash
  2. #Device name variable
  3. case $1 in
  4. dac )
  5. devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo"
  6. ;;
  7. dac2 )
  8. devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo"
  9. ;;
  10. line-out )
  11. devicename="alsa_output.pci-0000_00_14.2.analog-stereo"
  12. ;;
  13. esac
  14. # if [ "$1" = "dac" ]; then
  15. # devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo"
  16. # elif [ "$1" = "dac2" ]; then
  17. # devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo"
  18. # elif [ "$1" = "line-out" ]; then
  19. # devicename="alsa_output.pci-0000_00_14.2.analog-stereo"
  20. # fi
  21. echo "$devicename"
  22. #change the default sink
  23. pacmd "set-default-sink $devicename"
  24. #move all inputs to the new sink
  25. for app in $(pacmd list-sink-inputs | sed -n -e 's/index:[[:space:]]\([[:digit:]]\)/\1/p');
  26. do
  27. pacmd "move-sink-input $app $devicename"
  28. done