我已经通过 wsl 在 Windows 上安装了 Ubuntu。我遵循了以下指南:https://medium.com/geekculture/how-to-install-the-ubuntu-desktop-with-the-graphical-user-interface-in-wsl2-71f4b78431a4
目前 GUI 正在框架中打开,但我想让它以全屏模式打开。我有可能做到吗?
VcXsrv 的屏幕截图 以下是启动 VcXsrv 的脚本:
' define variables
dim application_object, shell_object, userprofile, command_object, standard_output_string
' create application object
set application_object = createobject("shell.application")
' create shell object
set shell_object = createobject("wscript.shell")
' store environment variable
username = shell_object.expandenvironmentstrings("%username%")
' run powershell in the background
application_object.shellexecute "powershell", "-file c:\users\" & username & "\.ubuntu\scripts\reload_vcxsrv.ps1", "", "", 0
' wait for powershell script to complete
wscript.sleep 3000
' create command object
set command_object = shell_object.exec("wsl genie --is-in-bottle")
' store standard output
standard_output = command_object.stdout.readall
' execute contents if shell is inside the genie container
if instr(standard_output, "inside") > 0 then
' run bash script
shell_object.run "bash /mnt/c/users/" & username & "/.ubuntu/scripts/start_desktop.sh", 0
' execute contents if shell is outside the genie container
else
' run bash script
shell_object.run "wsl genie -c bash /mnt/c/users/" & username & "/.ubuntu/scripts/start_desktop.sh", 0
end if
答案1
首先,这看起来不像是启动 VcXsrv 的脚本。根据您引用的博客文章,发现这里, 并且是:
# stop vcxsrv proccess that contains "0.0" in the program window title
get-process vcxsrv | where { $_.mainwindowtitle -like "*0.0*" } | stop-process
# start vcxsrv process in a large program window on display number one
start-process "c:\program files\vcxsrv\vcxsrv.exe" -argument ":0.0 -ac -nowgl -multimonitors -dpms"
第二,根据VcSrv 文档,命令行选项-fullscreen
就是您正在寻找的。
尝试修改上面的脚本并添加-fullscreen
到命令行。