Skip to content

Instantly share code, notes, and snippets.

@ktaragorn
Created February 5, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktaragorn/942ae1da3d93972ee9c9 to your computer and use it in GitHub Desktop.
Save ktaragorn/942ae1da3d93972ee9c9 to your computer and use it in GitHub Desktop.
Script that enabled loopback mode via pulseaudio and disabled it after use. This was used to loop audio from my laptop through my desktop to my monitor
#!/bin/sh
num=$(pactl load-module module-loopback channels=2)
echo $num
pactl set-source-port alsa_input.pci-0000_00_1e.2.analog-stereo analog-input-linein
pactl set-source-volume alsa_input.pci-0000_00_1e.2.analog-stereo 45%
zenity --info --title="Line In Active" --text="Press ok after Game Session"
pactl set-source-port alsa_input.pci-0000_00_1e.2.analog-stereo analog-input-microphone\;input-microphone-1
pactl set-source-volume alsa_input.pci-0000_00_1e.2.analog-stereo 100%
echo "unloading id: ${num}"
pactl unload-module ${num}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment