Last active
June 4, 2022 20:05
-
-
Save sulincix/ac7601a4fb271e498ad8971ce408bdd5 to your computer and use it in GitHub Desktop.
Merge Input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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