Created
December 9, 2019 09:03
-
-
Save rsletta/0b634d717dd812bfb841383ca91e4974 to your computer and use it in GitHub Desktop.
wsl-integration.sh after edit
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 | |
# export LIBGL_ALWAYS_INDIRECT=1 | |
#fi | |
# set up audio if pulse server is reachable only via tcp | |
#if type pactl > /dev/null 2>&1 \ | |
# && (! pactl info > /dev/null 2>&1 || pactl info 2> /dev/null | grep -q 'Default Sink: auto_null' ) \ | |
# && env PULSE_SERVER=tcp:${WSL_HOST} pactl info > /dev/null 2>&1; then | |
# export PULSE_SERVER=tcp:${WSL_HOST} | |
#fi | |
unset WSL_HOST | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@rsletta great job. I've tried to do the same, but there's nothing on my
/etc/profile.d/wsl-integration.sh
file through my ubuntu wsl2. do you know the root cause for this issue?