config-files/.local/bin/set_audio_sink

21 lines
518 B
Plaintext
Raw Normal View History

2023-06-29 14:14:27 -04:00
#!/bin/sh
# Load the module until it fails
while pactl load-module module-detect; do
:
done
if [ "$DISPLAY" = ":0" ]; then
2024-03-06 22:13:31 -05:00
# if ! pactl set-default-sink alsa_output.0.hdmi-stereo; then
# pactl set-default-sink alsa_output.1.hdmi-stereo
# fi
2024-03-18 17:53:49 -04:00
pactl set-default-sink alsa_output.1.analog-stereo
2023-06-29 14:14:27 -04:00
echo "$DISPLAY set audio"
elif [ "$DISPLAY" = ":10.0" ]; then
pactl set-default-sink xrdp-sink
echo "$DISPLAY set audio"
else
echo "The DISPLAY variable is set to: $DISPLAY, but not to :0 or :10.0"
fi