Skip to content

Instantly share code, notes, and snippets.

@kvaps
Created June 17, 2016 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kvaps/8bfd2976b3abf390c85b0458e7480eec to your computer and use it in GitHub Desktop.
Save kvaps/8bfd2976b3abf390c85b0458e7480eec to your computer and use it in GitHub Desktop.
check_xwin() {
if [ "$(uname -o)" == "Cygwin" ] ; then
# Check for Cygwin's Xorg
if [ -z $(whereis -b startxwin | cut -d: -f2-) ] ; then
# Start Xorg if not runned
if ! $(ps aux | grep -q XWin); then
startxwin
fi
fi
fi
if [ -z $DISPLAY ] ; then
export DISPLAY=":0"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment