aboutsummaryrefslogtreecommitdiff
path: root/bin/do_speakers.sh
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@debian.org>2018-10-23 17:22:12 -0400
committerRyan Kavanagh <rak@debian.org>2018-10-23 17:22:12 -0400
commitfc6ec337475a738e206f2e20c423e41ee6e069d9 (patch)
tree21b5d7f92bd1cf6f24feccdc184caee8846c2c29 /bin/do_speakers.sh
parentbugfix? (diff)
Add scripts to switch between speakers and DAC
Diffstat (limited to '')
-rwxr-xr-xbin/do_speakers.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/do_speakers.sh b/bin/do_speakers.sh
new file mode 100755
index 0000000..84b82e1
--- /dev/null
+++ b/bin/do_speakers.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+USB_CARD="alsa_card.usb-FiiO_DigiHug_USB_Audio-01"
+USB_SINK="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.iec958-stereo"
+SPEAKERS="alsa_output.pci-0000_00_1b.0.analog-stereo"
+
+pacmd set-sink-mute "${USB_SINK}" 1
+pacmd set-sink-mute "${SPEAKERS}" 0
+
+for s in $(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}')
+do
+ pacmd move-sink-input $s "${SPEAKERS}" >/dev/null 2>&1
+done