Skip to content

Instantly share code, notes, and snippets.

@sulincix
Last active June 4, 2022 20:05
Show Gist options
  • Save sulincix/ac7601a4fb271e498ad8971ce408bdd5 to your computer and use it in GitHub Desktop.
Save sulincix/ac7601a4fb271e498ad8971ce408bdd5 to your computer and use it in GitHub Desktop.
Merge Input
#!/bin/bash
# Create merged input. Merged all input sources.
# Insert this script in /etc/X11/xinit/xinitrc.d/
if [ "$1" == "-u" ]; then
pactl unload-module module-loopback
pactl unload-module module-null-sink
else
# Exit if already loaded.
if pacmd list-sources | grep "combined" &>/dev/null ; then
exit 0
fi
pactl load-module module-null-sink sink_name=combined sink_properties=device.description="MergedInput"
for device in $(pacmd list-sources | grep -v "combined" | grep "name: " | sed "s/.*<//g;s/>.*//g"); do
echo "$device"
pactl load-module module-loopback source="$device" sink=combined
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment