Commit b6498656 authored by runge's avatar runge

x11vnc: add gnome, kde, etc. FINDCREATEDISPLAY tags.

parent 570b8e90
2007-04-07 Karl Runge <runge@karlrunge.com>
* x11vnc: add gnome, kde, etc. FINDCREATEDISPLAY tags.
In check_ncache periodically check for changed desktop.
2007-03-24 Karl Runge <runge@karlrunge.com>
* x11vnc: reverse SSL connections. -sleepin option.
......
x11vnc README file Date: Fri Apr 6 15:54:32 EDT 2007
x11vnc README file Date: Fri Apr 6 23:19:54 EDT 2007
The following information is taken from these URLs:
......@@ -11415,7 +11415,10 @@ Options:
(or ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going to
be created. It sets the width and height of the new
display, and optionally the color depth as well.
display, and optionally the color depth as well. You
can also supply "kde", "gnome", "fvwm", "twm",
or "failsafe" to have the created display use that
mode for the user session.
To disable the option setting set the environment
variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
......
......@@ -817,7 +817,10 @@ void print_help(int mode) {
" (or ge=). This only has an effect in FINDCREATEDISPLAY\n"
" mode when a virtual X server such as Xvfb is going to\n"
" be created. It sets the width and height of the new\n"
" display, and optionally the color depth as well.\n"
" display, and optionally the color depth as well. You\n"
" can also supply \"kde\", \"gnome\", \"fvwm\", \"twm\",\n"
" or \"failsafe\" to have the created display use that\n"
" mode for the user session.\n"
"\n"
" To disable the option setting set the environment\n"
" variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.\n"
......
......@@ -954,6 +954,22 @@ char create_display[] =
" echo \"$session\"\n"
" return\n"
" fi\n"
" if [ \"X$have_gnome_session\" != \"X\" -a \"X$FD_SESS\" = \"Xgnome\" ]; then\n"
" echo \"$have_gnome_session\"\n"
" return\n"
" elif [ \"X$have_startkde\" != \"X\" -a \"X$FD_SESS\" = \"Xkde\" ]; then\n"
" echo \"$have_startkde\"\n"
" return\n"
" elif [ \"X$have_twm\" != \"X\" -a \"X$FD_SESS\" = \"Xtwm\" ]; then\n"
" echo \"$have_twm\"\n"
" return\n"
" elif [ \"X$have_fvwm2\" != \"X\" -a \"X$FD_SESS\" = \"Xfvwm\" ]; then\n"
" echo \"$have_fvwm2\"\n"
" return\n"
" elif [ \"X$have_xterm\" != \"X\" -a \"X$FD_SESS\" = \"Xfailsafe\" ]; then\n"
" echo \"$have_xterm\"\n"
" return\n"
" fi\n"
" home=`csh -f -c \"echo ~$USER\"`\n"
" if [ \"X$home\" = \"X\" -o ! -d \"$home\" ]; then\n"
" if [ \"X$have_root\" != \"X\" -a \"X$USER\" != \"Xroot\" ]; then\n"
......@@ -1173,7 +1189,7 @@ char create_display[] =
" if [ \"X$result\" = \"X1\" -a \"X$have_xmodmap\" != \"X\" ]; then\n"
" if [ \"X$have_root\" = \"X\" ]; then\n"
" nohup sh -c \"(\n"
" sleep 6;\n"
" sleep 10;\n"
" $have_xmodmap -display :$N -e 'keycode any = Shift_R' \\\n"
" -e 'add Shift = Shift_L Shift_R' \\\n"
" -e 'keycode any = Control_R' \\\n"
......@@ -1186,7 +1202,7 @@ char create_display[] =
" )\" 1>&2 &\n"
" else\n"
" (\n"
" sleep 1;\n"
" sleep 6;\n"
" $have_xmodmap -display :$N -e 'keycode any = Shift_R' \\\n"
" -e 'add Shift = Shift_L Shift_R' \\\n"
" -e 'keycode any = Control_R' \\\n"
......@@ -1288,7 +1304,7 @@ char create_display[] =
" p_ok=1\n"
"fi\n"
"\n"
"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb xauth mcookie md5sum xmodmap startkde gnome-session blackbox fvwm mwm openbox twm windowmaker metacity X Xorg XFree86 Xsun Xsession netstat\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\n"
"do\n"
" p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n"
" eval \"have_$p2=''\"\n"
......
......@@ -1505,7 +1505,7 @@ if (0) db = 1;
if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
char *opts = strchr(cmd, '-');
char st[] = "";
char geom[32];
char geom[32], xsess[32];
if (opts) {
opts++;
if (strstr(opts, "xdmcp")) {
......@@ -1515,6 +1515,7 @@ if (0) db = 1;
opts = st;
}
sprintf(geom, "NONE");
xsess[0] = '\0';
#if 0
if (!keep_unixpw_opts) {
fprintf(stderr, "no keep_unixpw_opts\n");
......@@ -1524,6 +1525,17 @@ if (!keep_unixpw_opts) {
#endif
if (unixpw && keep_unixpw_opts && keep_unixpw_opts[0] != '\0') {
char *q, *p, *t = strdup(keep_unixpw_opts);
if (strstr(t, "gnome")) {
sprintf(xsess, "gnome");
} else if (strstr(t, "kde")) {
sprintf(xsess, "kde");
} else if (strstr(t, "twm")) {
sprintf(xsess, "twm");
} else if (strstr(t, "fvwm")) {
sprintf(xsess, "fvwm");
} else if (strstr(t, "failsafe")) {
sprintf(xsess, "failsafe");
}
q = strstr(t, "ge=");
if (! q) q = strstr(t, "geom=");
if (! q) q = strstr(t, "geometry=");
......@@ -1555,15 +1567,18 @@ if (!keep_unixpw_opts) {
free(t);
}
set_env("FD_GEOM", geom);
set_env("FD_SESS", xsess);
if (unixpw && keep_unixpw_user) {
create_cmd = (char *) malloc(strlen(tmp)
+ strlen("env USER='' /bin/sh ")
+ strlen("env USER='' ")
+ strlen("env FD_SESS='' ")
+ strlen("env FD_GEOM='' /bin/sh ")
+ strlen(keep_unixpw_user) + 1
+ strlen(geom) + 1
+ strlen(xsess) + 1
+ strlen(opts) + 1);
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' /bin/sh %s %s",
keep_unixpw_user, geom, tmp, opts);
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' /bin/sh %s %s",
keep_unixpw_user, geom, xsess, tmp, opts);
} else {
create_cmd = (char *) malloc(strlen(tmp)
+ strlen("/bin/sh ") + 1 + strlen(opts) + 1);
......
......@@ -8062,6 +8062,9 @@ void set_ncache_xrootpmap(void) {
if (use_solid_bg) {
image = solid_image(NULL);
if (!quiet) {
rfbLog("set_ncache_xrootpmap: solid_image\n");
}
} else if (pmap != None) {
Pixmap pixmap = None;
unsigned char *d_pmap;
......@@ -8079,8 +8082,9 @@ void set_ncache_xrootpmap(void) {
rfbLog("set_ncache_xrootpmap: loading background pixmap: 0x%lx\n", pixmap);
}
} else {
rfbLog("set_ncache_xrootpmap: trying root background\n");
if (!quiet) {
rfbLog("set_ncache_xrootpmap: trying root background\n");
}
}
if (image == NULL) {
image = solid_root((char *) 0x1);
......@@ -8971,12 +8975,19 @@ if (hack_val == 2) {
n = 0;
ttot = 0;
if (dt_guess == NULL || now > dt_last + 30) {
if (dt_guess) {
free(dt_guess);
}
if (dt_guess == NULL || now > dt_last + 60) {
static char *dt_prev = NULL;
dt_prev = dt_guess;
dt_guess = strdup(guess_desktop());
if (ncache_xrootpmap && dt_prev && dt_guess) {
if (strcmp(dt_prev, dt_guess)) {
set_ncache_xrootpmap();
}
}
dt_last = now;
if (dt_prev) {
free(dt_prev);
}
}
if (dt_guess && !strcmp(dt_guess, "gnome")) {
dt_gnome = 1;
......
......@@ -962,7 +962,10 @@ Another option is "geom=WxH" or "geom=WxHxD"
(or ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going to
be created. It sets the width and height of the new
display, and optionally the color depth as well.
display, and optionally the color depth as well. You
can also supply "kde", "gnome", "fvwm", "twm",
or "failsafe" to have the created display use that
mode for the user session.
.IP
To disable the option setting set the environment
variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
......
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