💡 参考文章见Ref,感谢提供思路! 🗺️当前这篇博文地址:https://myoontyee.github.io/article/15435ad2.html ⚠️警告:博客文章禁止一切形式的非授权非法转载! ⚠️Attention: All forms of unauthorized illegal reposts are prohibited !
创建时间:2022年4月11日09:23:44 最新更新:2022年4月11日10:00:47
Problem Description:How does WSL and WSL2 realize that as soon as bash is opened, it is possible to interactively choose whether to visualize or not visualize the configuration through VcXsrv?
# 可视化 echo"" echo"" echo"==================================================" echo"Please input the visible mode you want to choose :" echo"1. Default: Just Print Here" echo"2. Display through VcXsrv" echo"==================================================" echo"The visible mode you want to choose is :" read visType
echo"==================================================" echo"Processing ..." echo"==================================================" echo"The environment you choose is :" if ((visType == 1)); then echo"1. Default: Just Print Here"
elif ((visType == 2)); then echo"2. Display through VcXsrv" export DISPLAY=`cat /etc/resolv.conf | grep nameserver | awk '{print $2}'`:0 # 这是WSL2的可视化配置 else echo"Type Error !" fi