Skip to content

Instantly share code, notes, and snippets.

@urbontaitis
Created December 17, 2020 06:18
Show Gist options
  • Save urbontaitis/0c963d9a95751ea008ef2064a8ad960b to your computer and use it in GitHub Desktop.
Save urbontaitis/0c963d9a95751ea008ef2064a8ad960b to your computer and use it in GitHub Desktop.
WSL2 Linux apps using X410

x410 guide: https://x410.dev/cookbook/wsl/using-x410-with-wsl2/

bat-launcher.vbs:

If WScript.Arguments.Count <= 0 Then
    WScript.Quit
End If	

bat = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")) & WScript.Arguments(0) & ".bat"
arg = ""

If WScript.Arguments.Count > 1 Then
    arg = WScript.Arguments(1)
End If

CreateObject("WScript.Shell").Run """" & bat & """ """ & arg & """", 0, False

start-idea.bat

@echo off

REM *** Start X410 in Windowed Apps mode. If X410 is already running in Desktop mode,
REM *** it'll be silently terminated and restarted in Windowed Apps mode.

x410.exe /wm

REM *** Start GNU Octave

ubuntu2004.exe run "export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0; /usr/bin/idea"

To run Linux GUI apps, create shortcut:

C:\Windows\System32\wscript.exe "C:\wsl-aps\bat-launcher.vbs" "start-idea"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment