Skip to content

Instantly share code, notes, and snippets.

@LAK132
Last active January 6, 2021 02:08
Show Gist options
  • Select an option

  • Save LAK132/fcc946f848f9ed87dbef289f2d30096d to your computer and use it in GitHub Desktop.

Select an option

Save LAK132/fcc946f848f9ed87dbef289f2d30096d to your computer and use it in GitHub Desktop.
Makefile DISPLAY example for when getting the IP address of the X11 server is required under WSL/cygwinX
ifeq ($(shell grep -a -h -i microsoft /proc/version),)
DISPLAY =
else
# For use on Windows (WSL) with cygwinX
# Requires xinit, xauth and xhost probably
# Start the X11 server with `path\to\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; exec /usr/bin/startxwin -- +iglx -nowgl -listen tcp"`
# If you get "Authorization required, but no authorization protocol specified"
# then try running `DISPLAY=:0.0 xhost +` in the cygwin terminal after
# starting the X11 server.
DISPLAY = "`cat /etc/resolv.conf | grep nameserver | awk '{ print $$2 }'`:0.0"
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment