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.

18 lines
482 B

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