From bedbbc6edd10292bceadfdb99190cc5777a3e5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Trellu?= Date: Mon, 20 Nov 2023 20:56:38 -0500 Subject: [PATCH] [common] Pass PULSE_SERVER socket to the root --- utils/common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/common.sh b/utils/common.sh index 88bf038..520b4ed 100644 --- a/utils/common.sh +++ b/utils/common.sh @@ -67,6 +67,8 @@ function detect_sound() { # This condition is only related to WSL2 as PulseServer socket will be # created under the /mnt/wslg/ directory. if command -v pactl &>>"$LOG_FILE"; then + # PULSE_SERVER is required by pactl as it is executed via sudo + export PULSE_SERVER="$PULSE_SOCKET_WSL2" SOUND_SERVER="$(pactl info | awk -F":" '$1 ~ /Server Name/ { print $2 }' | sed 's/^ *//')" export SOUND_SERVER fi