Commit a69ed666 authored by runge's avatar runge

x11vnc: improve FINDCREATEDISPLAY (-create) script, FD_GEOM, FD_SESS, FD_OPTS,...

x11vnc: improve FINDCREATEDISPLAY (-create) script, FD_GEOM, FD_SESS, FD_OPTS, FD_PROG env vars, add Xvnc support
parent f31f7159
2007-08-18 Karl Runge <runge@karlrunge.com>
* x11vnc: improve FINDCREATEDISPLAY (-create) script. Document
FD_GEOM, FD_SESS, FD_OPTS, FD_PROG env vars, add Xvnc support.
2007-08-15 Karl Runge <runge@karlrunge.com> 2007-08-15 Karl Runge <runge@karlrunge.com>
* x11vnc: add reverse -connect support to -display WAIT: * x11vnc: add reverse -connect support to -display WAIT:
i.e. -find, -create, -svc, ... mode. Document need for i.e. -find, -create, -svc, ... mode. Document need for
......
x11vnc README file Date: Wed Aug 15 15:33:58 EDT 2007 x11vnc README file Date: Fri Aug 17 23:09:12 EDT 2007
The following information is taken from these URLs: The following information is taken from these URLs:
...@@ -1778,16 +1778,19 @@ typedef unsigned int in_addr_t; ...@@ -1778,16 +1778,19 @@ typedef unsigned int in_addr_t;
There are precompiled x11vnc binaries built by other groups that are There are precompiled x11vnc binaries built by other groups that are
available at the following locations: available at the following locations:
Debian: (.deb) [315]http://packages.debian.org/x11vnc Slackware: (.tgz) [315]http://www.linuxpackages.net/
Slackware: (.tgz) [316]http://www.linuxpackages.net/ Redhat/Fedora: Redhat/Fedora: (.rpm) [316]http://dag.wieers.com/packages/x11vnc/
(.rpm) [317]http://dag.wieers.com/packages/x11vnc/ [317]http://dries.ulyssis.org/rpm/packages/x11vnc Debian: (.deb)
[318]http://dries.ulyssis.org/rpm/packages/x11vnc SuSE: (.rpm) [318]http://packages.debian.org/x11vnc (N.B: old and unmaintained;
better to compile from source) SuSE: (.rpm)
[319]http://linux01.gwdg.de/~pbleser/ Solaris: (pkg) [319]http://linux01.gwdg.de/~pbleser/ Solaris: (pkg)
[320]http://www.sunfreeware.com/ FreeBSD: (.tbz) [320]http://www.sunfreeware.com/ (N.B: very old; better to compile
[321]http://www.freebsd.org/ [322]http://www.freshports.org/net/x11vnc from source) FreeBSD: (.tbz) [321]http://www.freebsd.org/
OpenBSD: (.tgz) [323]http://www.openbsd.org/ NetBSD: (src) [322]http://www.freshports.org/net/x11vnc OpenBSD: (.tgz)
[324]http://pkgsrc.se/x11/x11vnc Nokia 770 (.deb) [323]http://www.openbsd.org/ (N.B: very old and unmaintained; better
to compile from source) NetBSD: (src) [324]http://pkgsrc.se/x11/x11vnc
Nokia 770 (.deb)
[325]http://mike.saunby.googlepages.com/x11vncfornokia7702 Sharp [325]http://mike.saunby.googlepages.com/x11vncfornokia7702 Sharp
Zaurus [326]http://www.pdaxrom.org/ and [327]http://www.focv.com/ Zaurus [326]http://www.pdaxrom.org/ and [327]http://www.focv.com/
...@@ -7849,10 +7852,10 @@ References ...@@ -7849,10 +7852,10 @@ References
312. http://www.karlrunge.com/x11vnc/x11vnc_sunos4.html 312. http://www.karlrunge.com/x11vnc/x11vnc_sunos4.html
313. http://www.karlrunge.com/x11vnc/index.html#building 313. http://www.karlrunge.com/x11vnc/index.html#building
314. http://www.karlrunge.com/x11vnc/index.html#faq-build 314. http://www.karlrunge.com/x11vnc/index.html#faq-build
315. http://packages.debian.org/x11vnc 315. http://www.linuxpackages.net/search_view.php?by=name&name=x11vnc
316. http://www.linuxpackages.net/search_view.php?by=name&name=x11vnc 316. http://dag.wieers.com/packages/x11vnc/
317. http://dag.wieers.com/packages/x11vnc/ 317. http://dries.ulyssis.org/rpm/packages/x11vnc/info.html
318. http://dries.ulyssis.org/rpm/packages/x11vnc/info.html 318. http://packages.debian.org/x11vnc
319. http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=Network/x11vnc/ 319. http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=Network/x11vnc/
320. http://www.sunfreeware.com/ 320. http://www.sunfreeware.com/
321. http://www.freebsd.org/cgi/ports.cgi?query=x11vnc&stype=all 321. http://www.freebsd.org/cgi/ports.cgi?query=x11vnc&stype=all
...@@ -11072,7 +11075,7 @@ x11vnc: a VNC server for real X displays ...@@ -11072,7 +11075,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options: Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions) % x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.9.3 lastmod: 2007-08-15 x11vnc: allow VNC connections to real X11 displays. 0.9.3 lastmod: 2007-08-17
x11vnc options: x11vnc options:
-display disp -auth file -N -display disp -auth file -N
...@@ -11186,7 +11189,7 @@ libvncserver-tight-extension options: ...@@ -11186,7 +11189,7 @@ libvncserver-tight-extension options:
% x11vnc -help % x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.9.3 lastmod: 2007-08-15 x11vnc: allow VNC connections to real X11 displays. 0.9.3 lastmod: 2007-08-17
(type "x11vnc -opts" to just list the options.) (type "x11vnc -opts" to just list the options.)
...@@ -11997,14 +12000,15 @@ Options: ...@@ -11997,14 +12000,15 @@ Options:
your long "login:" line press the Up arrow once your long "login:" line press the Up arrow once
(before typing anything else). (before typing anything else).
Another option is "geom=WxH" or "geom=WxHxD" Another option is "geom=WxH" or "geom=WxHxD" (or
(or ge=). This only has an effect in FINDCREATEDISPLAY ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going to mode when a virtual X server such as Xvfb is going
be created. It sets the width and height of the new to be created. It sets the width and height of
display, and optionally the color depth as well. You the new display, and optionally the color depth as
can also supply "kde", "gnome", "fvwm", "twm", well. You can also supply "gnome", "kde", "twm",
or "failsafe" to have the created display use that "fvwm", "mwm", "dtwm", "wmaker", "Xsession",
mode for the user session. or "failsafe" (same as "xterm") to have the created
display use that mode for the user session.
To disable the option setting set the environment To disable the option setting set the environment
variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc. variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
...@@ -12100,14 +12104,18 @@ Options: ...@@ -12100,14 +12104,18 @@ Options:
e.g., WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X and/or e.g., WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X and/or
leave out ones you do not want. The the extra case leave out ones you do not want. The the extra case
"X" means try to start up a real, hardware X server "X" means try to start up a real, hardware X server
using xinit(1) or startx(1). If there is already an using xinit(1) or startx(1). "Xvnc" also works. If
X server running the X case may only work on Linux there is already an X server running the X case may
(see startx(1)). only work on Linux (see startx(1)).
You can set the environment variable FD_GEOM (or You can set the environment variable FD_GEOM (or
X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width
and height and optionally the color depth of the and height and optionally the color depth of the
created display. created display. You can also set FD_SESS to be the
session (short name of the windowmanager: kde, gnome,
twm, failsafe), and FD_OPTS as extra options to pass
to the created X server. You can also set FD_PROG to
be the full path to the session/windowmanager program.
If you want the FINDCREATEDISPLAY session to contact an If you want the FINDCREATEDISPLAY session to contact an
XDMCP login manager (xdm/gdm/kdm) on the same machine, XDMCP login manager (xdm/gdm/kdm) on the same machine,
......
...@@ -834,14 +834,15 @@ void print_help(int mode) { ...@@ -834,14 +834,15 @@ void print_help(int mode) {
" your long \"login:\" line press the Up arrow once\n" " your long \"login:\" line press the Up arrow once\n"
" (before typing anything else).\n" " (before typing anything else).\n"
"\n" "\n"
" Another option is \"geom=WxH\" or \"geom=WxHxD\"\n" " Another option is \"geom=WxH\" or \"geom=WxHxD\" (or\n"
" (or ge=). This only has an effect in FINDCREATEDISPLAY\n" " ge=). This only has an effect in FINDCREATEDISPLAY\n"
" mode when a virtual X server such as Xvfb is going to\n" " mode when a virtual X server such as Xvfb is going\n"
" be created. It sets the width and height of the new\n" " to be created. It sets the width and height of\n"
" display, and optionally the color depth as well. You\n" " the new display, and optionally the color depth as\n"
" can also supply \"kde\", \"gnome\", \"fvwm\", \"twm\",\n" " well. You can also supply \"gnome\", \"kde\", \"twm\",\n"
" or \"failsafe\" to have the created display use that\n" " \"fvwm\", \"mwm\", \"dtwm\", \"wmaker\", \"Xsession\",\n"
" mode for the user session.\n" " or \"failsafe\" (same as \"xterm\") to have the created\n"
" display use that mode for the user session.\n"
"\n" "\n"
" To disable the option setting set the environment\n" " To disable the option setting set the environment\n"
" variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.\n" " variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.\n"
...@@ -937,14 +938,18 @@ void print_help(int mode) { ...@@ -937,14 +938,18 @@ void print_help(int mode) {
" e.g., WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X and/or\n" " e.g., WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X and/or\n"
" leave out ones you do not want. The the extra case\n" " leave out ones you do not want. The the extra case\n"
" \"X\" means try to start up a real, hardware X server\n" " \"X\" means try to start up a real, hardware X server\n"
" using xinit(1) or startx(1). If there is already an\n" " using xinit(1) or startx(1). \"Xvnc\" also works. If\n"
" X server running the X case may only work on Linux\n" " there is already an X server running the X case may\n"
" (see startx(1)).\n" " only work on Linux (see startx(1)).\n"
"\n" "\n"
" You can set the environment variable FD_GEOM (or\n" " You can set the environment variable FD_GEOM (or\n"
" X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width\n" " X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width\n"
" and height and optionally the color depth of the\n" " and height and optionally the color depth of the\n"
" created display.\n" " created display. You can also set FD_SESS to be the\n"
" session (short name of the windowmanager: kde, gnome,\n"
" twm, failsafe), and FD_OPTS as extra options to pass\n"
" to the created X server. You can also set FD_PROG to\n"
" be the full path to the session/windowmanager program.\n"
"\n" "\n"
" If you want the FINDCREATEDISPLAY session to contact an\n" " If you want the FINDCREATEDISPLAY session to contact an\n"
" XDMCP login manager (xdm/gdm/kdm) on the same machine,\n" " XDMCP login manager (xdm/gdm/kdm) on the same machine,\n"
......
...@@ -678,8 +678,8 @@ static char *dcop_session(void) { ...@@ -678,8 +678,8 @@ static char *dcop_session(void) {
p = strtok(out, "\n"); p = strtok(out, "\n");
while (p) { while (p) {
if (db) fprintf(stderr, "p: %s\n", p);
char *q = strstr(p, ".DCOP"); char *q = strstr(p, ".DCOP");
if (db) fprintf(stderr, "p: %s\n", p);
if (q == NULL) { if (q == NULL) {
; ;
} else if (host) { } else if (host) {
......
...@@ -963,8 +963,8 @@ char create_display[] = ...@@ -963,8 +963,8 @@ char create_display[] =
"}\n" "}\n"
"\n" "\n"
"findsession() {\n" "findsession() {\n"
" if [ \"X$session\" != \"X\" ]; then\n" " if [ \"X$FD_PROG\" != \"X\" ]; then\n"
" echo \"$session\"\n" " echo \"$FD_PROG\"\n"
" return\n" " return\n"
" fi\n" " fi\n"
" if [ \"X$have_gnome_session\" != \"X\" -a \"X$FD_SESS\" = \"Xgnome\" ]; then\n" " if [ \"X$have_gnome_session\" != \"X\" -a \"X$FD_SESS\" = \"Xgnome\" ]; then\n"
...@@ -979,12 +979,30 @@ char create_display[] = ...@@ -979,12 +979,30 @@ char create_display[] =
" elif [ \"X$have_fvwm2\" != \"X\" -a \"X$FD_SESS\" = \"Xfvwm\" ]; then\n" " elif [ \"X$have_fvwm2\" != \"X\" -a \"X$FD_SESS\" = \"Xfvwm\" ]; then\n"
" echo \"$have_fvwm2\"\n" " echo \"$have_fvwm2\"\n"
" return\n" " return\n"
" elif [ \"X$have_mwm\" != \"X\" -a \"X$FD_SESS\" = \"Xmwm\" ]; then\n" " elif [ \"X$have_mwm\" != \"X\" -a \"X$FD_SESS\" = \"Xmwm\" ]; then\n"
" echo \"$have_mwm\"\n" " echo \"$have_mwm\"\n"
" return\n" " return\n"
" elif [ \"X$have_dtwm\" != \"X\" -a \"X$FD_SESS\" = \"Xdtwm\" ]; then\n"
" echo \"$have_dtwm\"\n"
" return\n"
" elif [ \"X$have_windowmaker\" != \"X\" -a \"X$FD_SESS\" = \"Xwmaker\" ]; then\n"
" echo \"$have_windowmaker\"\n"
" return\n"
" elif [ \"X$have_wmaker\" != \"X\" -a \"X$FD_SESS\" = \"Xwmaker\" ]; then\n"
" echo \"$have_wmaker\"\n"
" return\n"
" elif [ \"X$have_Xsession\" != \"X\" -a \"X$FD_SESS\" = \"XXsession\" ]; then\n"
" echo \"$have_Xsession\"\n"
" return\n"
" elif [ \"X$have_Xsession\" != \"X\" -a \"X$FD_SESS\" = \"Xcde\" ]; then\n"
" echo \"$have_Xsession\"\n"
" return\n"
" elif [ \"X$have_xterm\" != \"X\" -a \"X$FD_SESS\" = \"Xfailsafe\" ]; then\n" " elif [ \"X$have_xterm\" != \"X\" -a \"X$FD_SESS\" = \"Xfailsafe\" ]; then\n"
" echo \"$have_xterm\"\n" " echo \"$have_xterm\"\n"
" return\n" " return\n"
" elif [ \"X$have_xterm\" != \"X\" -a \"X$FD_SESS\" = \"Xxterm\" ]; then\n"
" echo \"$have_xterm\"\n"
" return\n"
" fi\n" " fi\n"
" home=`csh -f -c \"echo ~$USER\"`\n" " home=`csh -f -c \"echo ~$USER\"`\n"
" if [ \"X$home\" = \"X\" -o ! -d \"$home\" ]; then\n" " if [ \"X$home\" = \"X\" -o ! -d \"$home\" ]; then\n"
...@@ -1090,11 +1108,11 @@ char create_display[] = ...@@ -1090,11 +1108,11 @@ char create_display[] =
" ns=4\n" " ns=4\n"
" if [ \"X$use_xdmcp_query\" = \"X1\" ]; then\n" " if [ \"X$use_xdmcp_query\" = \"X1\" ]; then\n"
" # we cannot use -nolisten tcp\n" " # we cannot use -nolisten tcp\n"
" echo \"$* -once -query localhost\" 1>&2\n" " echo \"$* -once -query localhost $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n" " if [ \"X$have_root\" != \"X\" ]; then\n"
" $have_nohup $* -once -query localhost 1>&2 &\n" " $have_nohup $* -once -query localhost $FD_OPTS 1>&2 &\n"
" else\n" " else\n"
" $have_nohup sh -c \"(sleep $ns; $* -once -query localhost -auth $authfile)\" 1>&2 &\n" " $have_nohup sh -c \"(sleep $ns; $* -once -query localhost -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" ns=0\n" " ns=0\n"
" result=1\n" " result=1\n"
" fi\n" " fi\n"
...@@ -1105,24 +1123,24 @@ char create_display[] = ...@@ -1105,24 +1123,24 @@ char create_display[] =
" else\n" " else\n"
" sxcmd=$have_xinit\n" " sxcmd=$have_xinit\n"
" fi\n" " fi\n"
" echo \"$sxcmd $sess -- $* -nolisten tcp -auth $authfile\" 1>&2\n" " echo \"$sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n" " if [ \"X$have_root\" != \"X\" ]; then\n"
" $sxcmd $sess -- $* -nolisten tcp -auth $authfile 1>&2 &\n" " $sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS 1>&2 &\n"
" else\n" " else\n"
" $have_nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* -nolisten tcp -auth $authfile)\" 1>&2 &\n" " $have_nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" ns=0\n" " ns=0\n"
" result=1\n" " result=1\n"
" fi\n" " fi\n"
" pid=$!\n" " pid=$!\n"
" else\n" " else\n"
" echo \"$* -nolisten tcp -auth $authfile\" 1>&2\n" " echo \"$* -nolisten tcp -auth $authfile $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n" " if [ \"X$have_root\" != \"X\" ]; then\n"
" $have_nohup $* -nolisten tcp -auth $authfile 1>&2 &\n" " $have_nohup $* -nolisten tcp -auth $authfile $FD_OPTS 1>&2 &\n"
" pid=$!\n" " pid=$!\n"
" sleep 2\n" " sleep 2\n"
" $have_nohup $sess 1>&2 &\n" " $have_nohup $sess 1>&2 &\n"
" else\n" " else\n"
" $have_nohup sh -c \"(sleep $ns; $* -nolisten tcp -auth $authfile)\" 1>&2 &\n" " $have_nohup sh -c \"(sleep $ns; $* -nolisten tcp -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" pid=$!\n" " pid=$!\n"
" sleep 2\n" " sleep 2\n"
" $have_nohup sh -c \"(sleep $ns; $sess)\" 1>&2 &\n" " $have_nohup sh -c \"(sleep $ns; $sess)\" 1>&2 &\n"
...@@ -1182,6 +1200,14 @@ char create_display[] = ...@@ -1182,6 +1200,14 @@ char create_display[] =
" #have_startx=$save_have_startx\n" " #have_startx=$save_have_startx\n"
"}\n" "}\n"
"\n" "\n"
"try_Xvnc() {\n"
" if [ \"X$have_Xvnc\" = \"X\" ]; then\n"
" return\n"
" fi\n"
"\n"
" server $have_Xvnc :$N -geometry $geom -depth $depth\n"
"}\n"
"\n"
"try_Xvfb() {\n" "try_Xvfb() {\n"
" if [ \"X$have_Xvfb\" = \"X\" ]; then\n" " if [ \"X$have_Xvfb\" = \"X\" ]; then\n"
" return\n" " return\n"
...@@ -1212,7 +1238,18 @@ char create_display[] = ...@@ -1212,7 +1238,18 @@ char create_display[] =
" -e 'keycode any = Alt_R' \\\n" " -e 'keycode any = Alt_R' \\\n"
" -e 'keycode any = Meta_L' \\\n" " -e 'keycode any = Meta_L' \\\n"
" -e 'clear Mod1' \\\n" " -e 'clear Mod1' \\\n"
" -e 'add Mod1 = Alt_L Alt_R Meta_L' \\\n" " -e 'add Mod1 = Alt_L Alt_R Meta_L';\n"
" if uname | grep SunOS > /dev/null; then\n"
" for sym in SunAudioMute SunAudioLowerVolume SunAudioRaiseVolume\n"
" do\n"
" if $have_xmodmap -pk | grep -w \\$sym > /dev/null; then\n"
" :\n"
" else\n"
" $have_xmodmap -e \\\"keycode any = \\$sym\\\"\n"
" fi\n"
" done\n"
" fi\n"
"\n"
" )\" 1>&2 &\n" " )\" 1>&2 &\n"
" else\n" " else\n"
" (\n" " (\n"
...@@ -1225,7 +1262,18 @@ char create_display[] = ...@@ -1225,7 +1262,18 @@ char create_display[] =
" -e 'keycode any = Alt_R' \\\n" " -e 'keycode any = Alt_R' \\\n"
" -e 'keycode any = Meta_L' \\\n" " -e 'keycode any = Meta_L' \\\n"
" -e 'clear Mod1' \\\n" " -e 'clear Mod1' \\\n"
" -e 'add Mod1 = Alt_L Alt_R Meta_L' \\\n" " -e 'add Mod1 = Alt_L Alt_R Meta_L';\n"
" # this is to workaround a bug with JDS Solaris 10 gnome-session-daemon.\n"
" if uname | grep SunOS > /dev/null; then\n"
" for sym in SunAudioMute SunAudioLowerVolume SunAudioRaiseVolume\n"
" do\n"
" if $have_xmodmap -pk | grep -w $sym > /dev/null; then\n"
" :\n"
" else\n"
" $have_xmodmap -e \"keycode any = $sym\"\n"
" fi\n"
" done\n"
" fi\n"
" ) 1>&2 &\n" " ) 1>&2 &\n"
" fi\n" " fi\n"
" fi\n" " fi\n"
...@@ -1332,7 +1380,7 @@ char create_display[] = ...@@ -1332,7 +1380,7 @@ char create_display[] =
" p_ok=1\n" " p_ok=1\n"
"fi\n" "fi\n"
"\n" "\n"
"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb xauth mcookie md5sum xmodmap startkde gnome-session blackbox fvwm2 mwm openbox twm windowmaker metacity X Xorg XFree86 Xsun Xsession netstat nohup\n" "for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb Xvnc xauth mcookie md5sum xmodmap startkde gnome-session blackbox fvwm2 mwm openbox twm windowmaker wmaker metacity X Xorg XFree86 Xsun Xsession dtwm netstat nohup\n"
"do\n" "do\n"
" p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n" " p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n"
" eval \"have_$p2=''\"\n" " eval \"have_$p2=''\"\n"
...@@ -1383,6 +1431,8 @@ char create_display[] = ...@@ -1383,6 +1431,8 @@ char create_display[] =
" try_Xdummy\n" " try_Xdummy\n"
" elif echo \"$curr_try\" | grep -iw \"Xvfb\" > /dev/null; then\n" " elif echo \"$curr_try\" | grep -iw \"Xvfb\" > /dev/null; then\n"
" try_Xvfb\n" " try_Xvfb\n"
" elif echo \"$curr_try\" | grep -iw \"Xvnc\" > /dev/null; then\n"
" try_Xvnc\n"
" elif echo \"$curr_try\" | grep -iw \"X\" > /dev/null; then\n" " elif echo \"$curr_try\" | grep -iw \"X\" > /dev/null; then\n"
" try_X\n" " try_X\n"
" fi\n" " fi\n"
......
...@@ -1789,7 +1789,7 @@ if (0) db = 1; ...@@ -1789,7 +1789,7 @@ if (0) db = 1;
if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) { if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
char *opts = strchr(cmd, '-'); char *opts = strchr(cmd, '-');
char st[] = ""; char st[] = "";
char geom[32], xsess[32]; char geom[128], xsess[128], fdopts[128], fdprog[128];
if (opts) { if (opts) {
opts++; opts++;
if (strstr(opts, "xdmcp")) { if (strstr(opts, "xdmcp")) {
...@@ -1801,6 +1801,8 @@ if (0) db = 1; ...@@ -1801,6 +1801,8 @@ if (0) db = 1;
sprintf(geom, "NONE"); sprintf(geom, "NONE");
xsess[0] = '\0'; xsess[0] = '\0';
geom[0] = '\0'; geom[0] = '\0';
fdopts[0] = '\0';
fdprog[0] = '\0';
#if 0 #if 0
if (!keep_unixpw_opts) { if (!keep_unixpw_opts) {
fprintf(stderr, "no keep_unixpw_opts\n"); fprintf(stderr, "no keep_unixpw_opts\n");
...@@ -1820,6 +1822,16 @@ if (!keep_unixpw_opts) { ...@@ -1820,6 +1822,16 @@ if (!keep_unixpw_opts) {
sprintf(xsess, "fvwm"); sprintf(xsess, "fvwm");
} else if (strstr(t, "mwm")) { } else if (strstr(t, "mwm")) {
sprintf(xsess, "mwm"); sprintf(xsess, "mwm");
} else if (strstr(t, "cde")) {
sprintf(xsess, "cde");
} else if (strstr(t, "dtwm")) {
sprintf(xsess, "dtwm");
} else if (strstr(t, "xterm")) {
sprintf(xsess, "xterm");
} else if (strstr(t, "wmaker")) {
sprintf(xsess, "wmaker");
} else if (strstr(t, "Xsession")) {
sprintf(xsess, "Xsession");
} else if (strstr(t, "failsafe")) { } else if (strstr(t, "failsafe")) {
sprintf(xsess, "failsafe"); sprintf(xsess, "failsafe");
} }
...@@ -1855,14 +1867,22 @@ if (!keep_unixpw_opts) { ...@@ -1855,14 +1867,22 @@ if (!keep_unixpw_opts) {
free(t); free(t);
} }
if (geom[0] == '\0' && getenv("FD_GEOM")) { if (geom[0] == '\0' && getenv("FD_GEOM")) {
snprintf(geom, 30, "%s", getenv("FD_GEOM")); snprintf(geom, 120, "%s", getenv("FD_GEOM"));
} }
if (xsess[0] == '\0' && getenv("FD_SESS")) { if (xsess[0] == '\0' && getenv("FD_SESS")) {
snprintf(xsess, 30, "%s", getenv("FD_SESS")); snprintf(xsess, 120, "%s", getenv("FD_SESS"));
}
if (fdopts[0] == '\0' && getenv("FD_OPTS")) {
snprintf(fdopts, 120, "%s", getenv("FD_OPTS"));
}
if (fdprog[0] == '\0' && getenv("FD_PROG")) {
snprintf(fdprog, 120, "%s", getenv("FD_PROG"));
} }
set_env("FD_GEOM", geom); set_env("FD_GEOM", geom);
set_env("FD_SESS", xsess); set_env("FD_SESS", xsess);
set_env("FD_OPTS", fdopts);
set_env("FD_PROG", fdprog);
if (usslpeer || (unixpw && keep_unixpw_user)) { if (usslpeer || (unixpw && keep_unixpw_user)) {
char *uu = usslpeer; char *uu = usslpeer;
...@@ -1872,13 +1892,17 @@ if (!keep_unixpw_opts) { ...@@ -1872,13 +1892,17 @@ if (!keep_unixpw_opts) {
create_cmd = (char *) malloc(strlen(tmp)+1 create_cmd = (char *) malloc(strlen(tmp)+1
+ strlen("env USER='' ") + strlen("env USER='' ")
+ strlen("FD_GEOM='' ") + strlen("FD_GEOM='' ")
+ strlen("FD_OPTS='' ")
+ strlen("FD_PROG='' ")
+ strlen("FD_SESS='' /bin/sh ") + strlen("FD_SESS='' /bin/sh ")
+ strlen(uu) + 1 + strlen(uu) + 1
+ strlen(geom) + 1 + strlen(geom) + 1
+ strlen(xsess) + 1 + strlen(xsess) + 1
+ strlen(fdopts) + 1
+ strlen(fdprog) + 1
+ strlen(opts) + 1); + strlen(opts) + 1);
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' /bin/sh %s %s", sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' FD_OPTS='%s' FD_PROG='%s' /bin/sh %s %s",
uu, geom, xsess, tmp, opts); uu, geom, xsess, fdopts, fdprog, tmp, opts);
} else { } else {
create_cmd = (char *) malloc(strlen(tmp) create_cmd = (char *) malloc(strlen(tmp)
+ strlen("/bin/sh ") + 1 + strlen(opts) + 1); + strlen("/bin/sh ") + 1 + strlen(opts) + 1);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.TH X11VNC "1" "August 2007" "x11vnc " "User Commands" .TH X11VNC "1" "August 2007" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.9.3, lastmod: 2007-08-15 version: 0.9.3, lastmod: 2007-08-17
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
...@@ -983,14 +983,15 @@ type and enter your password incorrectly, to retrieve ...@@ -983,14 +983,15 @@ type and enter your password incorrectly, to retrieve
your long "login:" line press the Up arrow once your long "login:" line press the Up arrow once
(before typing anything else). (before typing anything else).
.IP .IP
Another option is "geom=WxH" or "geom=WxHxD" Another option is "geom=WxH" or "geom=WxHxD" (or
(or ge=). This only has an effect in FINDCREATEDISPLAY ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going to mode when a virtual X server such as Xvfb is going
be created. It sets the width and height of the new to be created. It sets the width and height of
display, and optionally the color depth as well. You the new display, and optionally the color depth as
can also supply "kde", "gnome", "fvwm", "twm", well. You can also supply "gnome", "kde", "twm",
or "failsafe" to have the created display use that "fvwm", "mwm", "dtwm", "wmaker", "Xsession",
mode for the user session. or "failsafe" (same as "xterm") to have the created
display use that mode for the user session.
.IP .IP
To disable the option setting set the environment To disable the option setting set the environment
variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc. variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
...@@ -1094,16 +1095,20 @@ using ...@@ -1094,16 +1095,20 @@ using
.IR xinit (1) .IR xinit (1)
or or
.IR startx (1). .IR startx (1).
If there is already an "Xvnc" also works. If
X server running the X case may only work on Linux there is already an X server running the X case may
(see only work on Linux (see
.IR startx (1) .IR startx (1)
). ).
.IP .IP
You can set the environment variable FD_GEOM (or You can set the environment variable FD_GEOM (or
X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width
and height and optionally the color depth of the and height and optionally the color depth of the
created display. created display. You can also set FD_SESS to be the
session (short name of the windowmanager: kde, gnome,
twm, failsafe), and FD_OPTS as extra options to pass
to the created X server. You can also set FD_PROG to
be the full path to the session/windowmanager program.
.IP .IP
If you want the FINDCREATEDISPLAY session to contact an If you want the FINDCREATEDISPLAY session to contact an
XDMCP login manager (xdm/gdm/kdm) on the same machine, XDMCP login manager (xdm/gdm/kdm) on the same machine,
......
...@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0; ...@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.3 lastmod: 2007-08-15"; char lastmod[] = "0.9.3 lastmod: 2007-08-17";
/* X display info */ /* X display info */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment