dotfiles/PS/launch_wsl_xserve.ps1

11 lines
394 B
PowerShell

param (
[string]
$CommandPath = "konsole"
)
$server = (wsl.exe cat /etc/resolv.conf | Select-String nameserver | Out-String | ForEach-Object { $_.Split(" ")[1]}).Trim()
# Set the display variable for this process
Set-Item -Path Env:DISPLAY "$server`:0.0"
Set-Item -Path Env:WSLENV "DISPLAY/u"
Start-Process -FilePath "wsl.exe" -ArgumentList $CommandPath -WindowStyle Hidden