From 8129922887ae922e9c1f021e7b1c1560b303ddcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Trellu?= Date: Mon, 20 Nov 2023 20:54:01 -0500 Subject: [PATCH] [common] Look a file only --- utils/common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/common.sh b/utils/common.sh index 42bc0e70..038e2d5e 100644 --- a/utils/common.sh +++ b/utils/common.sh @@ -63,11 +63,11 @@ function detect_sound() { SOUND_SERVER="PulseAudio (on PipeWire)" fi export SOUND_SERVER - elif [ -f "$PULSE_SOCKET_WSL2" ]; then - # This condition is only related to WSL2 as PulseServer socket will be under - # /mnt/wslg/ directory. + elif [ -s "$PULSE_SOCKET_WSL2" ]; then + # 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 - SOUND_SERVER="$(pactl info | awk -F":" '$1 ~ /Server Name/ { print $2 }' | sed 's/^ *//')"\ + SOUND_SERVER="$(pactl info | awk -F":" '$1 ~ /Server Name/ { print $2 }' | sed 's/^ *//')" export SOUND_SERVER fi # Looking for strictly for pipepire process