aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pulse2jack32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/pulse2jack b/bin/pulse2jack
new file mode 100755
index 0000000..73ede01
--- /dev/null
+++ b/bin/pulse2jack
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+IFS=$'\n\t'
+
+
+function jack_module_on()
+{
+ echo "Enabling JACK sink and source."
+ /usr/bin/pacmd load-module module-jack-sink channels=2
+ /usr/bin/pacmd load-module module-jack-source channels=2
+ /usr/bin/pacmd set-default-sink jack_out
+ /usr/bin/pacmd set-default-source jack_in
+}
+
+function jack_module_off()
+{
+ echo "Disabling JACK sink and source."
+ /usr/bin/pacmd unload-module module-jack-sink
+ /usr/bin/pacmd unload-module module-jack-source
+}
+
+case "$1" in
+ "on")
+ jack_module_on
+ ;;
+ "off")
+ jack_module_off
+ ;;
+esac
+
+exit 0