diff options
author | David Runge <dave@sleepmap.de> | 2017-06-26 14:37:41 +0200 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2017-06-26 14:37:41 +0200 |
commit | 52605b80cfab4519891c2363f9320d743573efd4 (patch) | |
tree | 79bc6b01c88cc16abc16793885be0d3157618212 | |
parent | e64f851197c82c848c40d9be274e5a77e2dbb892 (diff) | |
download | dotfiles-52605b80cfab4519891c2363f9320d743573efd4.tar.gz dotfiles-52605b80cfab4519891c2363f9320d743573efd4.tar.bz2 dotfiles-52605b80cfab4519891c2363f9320d743573efd4.tar.xz dotfiles-52605b80cfab4519891c2363f9320d743573efd4.zip |
bin/pulse2jack: Adding script to create and default JACK sink for pulse. Can also unload the modules again.
-rwxr-xr-x | bin/pulse2jack | 32 |
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 |