config-files/.local/bin/set_audio_sink

21 lines
492 B
Bash
Executable File

#!/bin/sh
# Load the module until it fails
while pactl load-module module-detect; do
:
done
if [ "$DISPLAY" = ":0" ]; then
# if ! pactl set-default-sink alsa_output.0.hdmi-stereo; then
# pactl set-default-sink alsa_output.1.hdmi-stereo
# fi
pactl set-default-sink 1
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