This file contains 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
if type pactl > /dev/null 2>&1 || type xvinfo > /dev/null 2>&1; then | |
# detect WSL host | |
if type systemd-detect-virt > /dev/null 2>&1 && test "$(systemd-detect-virt -c)" != wsl -a -e /etc/resolv.conf; then | |
WSL_HOST=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null) | |
fi | |
WSL_HOST=${WSL_HOST:-localhost} | |
# set DISPLAY if there is an X11 server running | |
#if type xvinfo > /dev/null 2>&1 && env DISPLAY=${WSL_HOST}:0 xvinfo > /dev/null 2>&1; then | |
# export DISPLAY=${WSL_HOST}:0 |