summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-10-30 10:38:00 +0100
committerPierre Ossman <ossman@cendio.se>2015-10-30 10:38:00 +0100
commit10fe061c28bc9ca661095d38ee39b24ec2283687 (patch)
tree3e94ba7fbccbed048180928f2381964b5a88ae2b
parent55d6085e1debca23772eea19a1e1bdaffb0ce75a (diff)
parent5d771f49390db9e4efe187de611b93d40ff82220 (diff)
downloadtigervnc-10fe061c28bc9ca661095d38ee39b24ec2283687.tar.gz
tigervnc-10fe061c28bc9ca661095d38ee39b24ec2283687.zip
Merge branch 'patch-1' of https://github.com/Siot/tigervnc
-rwxr-xr-xunix/vncserver41
-rw-r--r--unix/vncserver.man6
2 files changed, 34 insertions, 13 deletions
diff --git a/unix/vncserver b/unix/vncserver
index c7fdc655..d7cd711e 100755
--- a/unix/vncserver
+++ b/unix/vncserver
@@ -53,6 +53,7 @@ $vncJavaFiles = (((-d "$vncClasses") && "$vncClasses") ||
((-d "/usr/local/vnc/classes") && "/usr/local/vnc/classes"));
$vncUserDir = "$ENV{HOME}/.vnc";
+$skipxstartup = 0;
$xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority";
$defaultXStartup
@@ -133,7 +134,7 @@ if ($fontPath eq "") {
# Check command line options
&ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,
- "-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0);
+ "-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0,"-noxstartup",0);
&Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});
@@ -155,6 +156,9 @@ if ($opt{'-depth'}) {
if ($opt{'-pixelformat'}) {
$pixelformat = $opt{'-pixelformat'};
}
+if ($opt{'-noxstartup'}) {
+ $skipxstartup = 1;
+}
if ($opt{'-fp'}) {
$fontPath = $opt{'-fp'};
$fpArgSpecified = 1;
@@ -355,12 +359,14 @@ warn "\nNew '$desktopName' desktop is $host:$displayNumber\n\n";
# Create the user's xstartup script if necessary.
-if (!(-e "$vncUserDir/xstartup")) {
- warn "Creating default startup script $vncUserDir/xstartup\n";
- open(XSTARTUP, ">$vncUserDir/xstartup");
- print XSTARTUP $defaultXStartup;
- close(XSTARTUP);
- chmod 0755, "$vncUserDir/xstartup";
+if (! $skipxstartup) {
+ if (!(-e "$vncUserDir/xstartup")) {
+ warn "Creating default startup script $vncUserDir/xstartup\n";
+ open(XSTARTUP, ">$vncUserDir/xstartup");
+ print XSTARTUP $defaultXStartup;
+ close(XSTARTUP);
+ chmod 0755, "$vncUserDir/xstartup";
+ }
}
# Create the user's config file if necessary.
@@ -375,7 +381,9 @@ if (!(-e "$vncUserDir/config")) {
# Run the X startup script.
-warn "Starting applications specified in $vncUserDir/xstartup\n";
+if (! $skipxstartup) {
+ warn "Starting applications specified in $vncUserDir/xstartup\n";
+}
warn "Log file is $desktopLog\n\n";
# If the unix domain socket exists then use that (DISPLAY=:n) otherwise use
@@ -393,18 +401,24 @@ $ENV{VNCDESKTOP}= $desktopName;
system($exedir."vncconfig -nowin >> " . &quotedString($desktopLog) . " 2>&1 &");
if ($opt{'-fg'}) {
- system("$vncUserDir/xstartup >> " . &quotedString($desktopLog) . " 2>&1");
+ if (! $skipxstartup) {
+ system("$vncUserDir/xstartup >> " . &quotedString($desktopLog) . " 2>&1");
+ }
if (kill 0, `cat $pidFile`) {
$opt{'-kill'} = ':'.$displayNumber;
&Kill();
}
} else {
if ($opt{'-autokill'}) {
- system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> "
- . &quotedString($desktopLog) . " 2>&1 &");
+ if (! $skipxstartup) {
+ system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> "
+ . &quotedString($desktopLog) . " 2>&1 &");
+ }
} else {
- system("$vncUserDir/xstartup >> " . &quotedString($desktopLog)
- . " 2>&1 &");
+ if (! $skipxstartup) {
+ system("$vncUserDir/xstartup >> " . &quotedString($desktopLog)
+ . " 2>&1 &");
+ }
}
}
@@ -621,6 +635,7 @@ sub Usage
" [-fp <font-path>]\n".
" [-fg]\n".
" [-autokill]\n".
+ " [-noxstartup]\n".
" <Xvnc-options>...\n\n".
" $prog -kill <X-display>\n\n".
" $prog -list\n\n");
diff --git a/unix/vncserver.man b/unix/vncserver.man
index 5ba6b8f1..37fe315e 100644
--- a/unix/vncserver.man
+++ b/unix/vncserver.man
@@ -16,6 +16,7 @@ vncserver \- start or stop a VNC server
.IR font-path ]
.RB [ \-fg ]
.RB [ \-autokill ]
+.RB [ \-noxstartup ]
.RI [ Xvnc-options... ]
.br
.BI "vncserver \-kill :" display#
@@ -123,6 +124,11 @@ this has the effect of terminating Xvnc when the user logs out of the window
manager.
.
.TP
+.B \-noxstartup
+Do not run the %HOME/.vnc/xstartup script after launching Xvnc. This
+option allows you to manually start a window manager in your TigerVNC session.
+.
+.TP
.B \-list
Lists all VNC desktops started by vncserver.