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.

32 lines
913 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. devicename="alsa_output.pci-0000_00_14.2.iec958-stereo"
  13. ;;
  14. esac
  15. # if [ "$1" = "dac" ]; then
  16. # devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo"
  17. # elif [ "$1" = "dac2" ]; then
  18. # devicename="alsa_output.usb-1852_DigiHug_USB_Audio-01.analog-stereo"
  19. # elif [ "$1" = "line-out" ]; then
  20. # devicename="alsa_output.pci-0000_00_14.2.analog-stereo"
  21. # fi
  22. echo "$devicename"
  23. #change the default sink
  24. pacmd "set-default-sink $devicename"
  25. #move all inputs to the new sink
  26. for app in $(pacmd list-sink-inputs | sed -n -e 's/index:[[:space:]]\([[:digit:]]\)/\1/p');
  27. do
  28. pacmd "move-sink-input $app $devicename"
  29. done