Last active
October 26, 2021 07:20
-
-
Save ongyx/bc5d4b7b39027a527c3ae90d3a72d167 to your computer and use it in GitHub Desktop.
[WSL2] Start a new bash shell that can run graphical apps (using VcXsrv or another X server). Your original shell will be restored when you exit xshell (script is isolated)
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
export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0 | |
export LIBGL_ALWAYS_INDIRECT=1 | |
export GDK_DPI_SCALE=1.25 | |
export QT_SCALE_FACTOR=1.25 | |
log=/dev/null | |
/mnt/c/Program\ Files/VcXsrv/vcxsrv.exe -multiwindow -ac -wgl -dpi auto &> $log & | |
bash | |
/mnt/c/Windows/System32/taskkill.exe /F /IM vcxsrv.exe /T &> $log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment