Better default xstartup file which attempts to launch the user's chosen window manager before falling back to twm.  This is borrowed from TurboVNC 0.5.1.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3724 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/vncserver b/unix/vncserver
index a263511..a861f58 100755
--- a/unix/vncserver
+++ b/unix/vncserver
@@ -55,6 +55,24 @@
 
 $defaultXStartup
     = ("#!/bin/sh\n\n".
+       "unset SESSION_MANAGER\n".
+       "OS=`uname -s`\n".
+       "if [ \$OS = 'Linux' ]; then\n".
+       "  case \"\$WINDOWMANAGER\" in\n".
+       "    \*gnome\*)\n".
+       "      if [ -e /etc/SuSE-release ]; then\n".
+       "        PATH=\$PATH:/opt/gnome/bin\n".
+       "        export PATH\n".
+       "      fi\n".
+       "      ;;\n".
+       "  esac\n".
+       "fi\n".
+       "if [ -x /etc/X11/xinit/xinitrc ]; then\n".
+       "  exec /etc/X11/xinit/xinitrc\n".
+       "fi\n".
+       "if [ -f /etc/X11/xinit/xinitrc ]; then\n".
+       "  exec sh /etc/X11/xinit/xinitrc\n".
+       "fi\n".
        "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n".
        "xsetroot -solid grey\n".
        "vncconfig -iconic &\n".