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.

19 lines
554 B

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