Last active
February 26, 2026 17:59
-
-
Save sulincix/e735559a4603a7f509808f194ac94eb3 to your computer and use it in GitHub Desktop.
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 output sources. | |
| # Insert this script in /etc/X11/xinit/xinitrc.d/ | |
| if [ "$1" == "-u" ]; then | |
| # Unload the loopback and null sink modules | |
| pactl unload-module module-loopback | |
| pactl unload-module module-null-sink | |
| else | |
| # Exit if already loaded. | |
| if pactl list sources short | grep "combined" &>/dev/null ; then | |
| exit 0 | |
| fi | |
| # Load a null sink with a specific name and description | |
| pactl load-module module-null-sink sink=inputs sink_name=combined sink_properties=device.description="Merged Output" | |
| # Load loopback modules for each source | |
| for device in $(pactl list sources short | awk '/^[0-9]+/ {print $2}' | grep -v "combined"); 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