Skip to content

Instantly share code, notes, and snippets.

@AirManH
Last active November 18, 2020 13:00
Show Gist options
  • Select an option

  • Save AirManH/de7237a70d0b5cb1c401da9c39d7a427 to your computer and use it in GitHub Desktop.

Select an option

Save AirManH/de7237a70d0b5cb1c401da9c39d7a427 to your computer and use it in GitHub Desktop.

Revisions

  1. AirManH revised this gist Nov 18, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion start-gnome-terminal.ahk
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    ;; Description: press Meta + Enter to open gnome-terminal in WSL
    ;; Description:
    ;; press Meta + Enter to open gnome-terminal in WSL
    ;; requirement:
    ;; - vcxsrv
    ;; - wsl
  2. AirManH created this gist Nov 18, 2020.
    15 changes: 15 additions & 0 deletions start-gnome-terminal.ahk
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    ;; Description: press Meta + Enter to open gnome-terminal in WSL
    ;; requirement:
    ;; - vcxsrv
    ;; - wsl
    ;; - gnome-termial (in wsl)
    #Enter::
    ;; if vcxsrv not exist, start it
    Process, Exist, vcxsrv.exe
    if (not ErrorLevel) {
    Run "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl
    ;; wait 2000ms for vcxsrv to start
    Sleep, 2000
    }
    Run %comspec% /c "wsl export LIBGL_ALWAYS_INDIRECT=1; export DISPLAY=localhost:0.0; export $(dbus-launch); exec gnome-terminal"
    Return