From 873b92e1698d163f58b6574c0fef2e6e88639ba0 Mon Sep 17 00:00:00 2001 From: Rodrigo Estevao Date: Mon, 7 Feb 2022 10:37:56 -0300 Subject: [PATCH] Adding a plugin that set the required environment variable to VcXsrv --- plugins/vcxsrv/README.md | 22 ++++++++++++++++++++++ plugins/vcxsrv/vcxsrv.plugin.zsh | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 plugins/vcxsrv/README.md create mode 100644 plugins/vcxsrv/vcxsrv.plugin.zsh diff --git a/plugins/vcxsrv/README.md b/plugins/vcxsrv/README.md new file mode 100644 index 000000000..ccbd4645c --- /dev/null +++ b/plugins/vcxsrv/README.md @@ -0,0 +1,22 @@ +# VcXsrv plugin + +This plugin add the environment variables to allow graphic apps running on WSL +to find the VcXsrv instance intalled on Windows. It assumes that you have let +the VcXsrv configured with your local machine. + +To use it, add `vcxsrv` to the plugins array in your zshrc file: + +```zsh +plugins=(... vcxsrv) +``` + +## Requirements + +In order to make this work, you will need to have the folowing softwares +installed: +* [WSL2](https://docs.microsoft.com/en-us/windows/wsl/); +* [VxXsrv](https://sourceforge.net/projects/vcxsrv/). + + VcXsrv installed on Windows. + +More info on the usage and install: https://github.com/direnv/direnv diff --git a/plugins/vcxsrv/vcxsrv.plugin.zsh b/plugins/vcxsrv/vcxsrv.plugin.zsh new file mode 100644 index 000000000..659aea39b --- /dev/null +++ b/plugins/vcxsrv/vcxsrv.plugin.zsh @@ -0,0 +1,2 @@ +export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 # in WSL 2 +export LIBGL_ALWAYS_INDIRECT=1