Skip to content

Instantly share code, notes, and snippets.

@AirManH
Last active November 18, 2020 13:00
Show Gist options
  • Save AirManH/de7237a70d0b5cb1c401da9c39d7a427 to your computer and use it in GitHub Desktop.
Save AirManH/de7237a70d0b5cb1c401da9c39d7a427 to your computer and use it in GitHub Desktop.
press Meta + Enter to open gnome-terminal in WSL
;; 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment