Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README5
-rwxr-xr-xscripts/shell/start-sugar22
2 files changed, 26 insertions, 1 deletions
diff --git a/README b/README
index 7cd23f9..01ed54a 100644
--- a/README
+++ b/README
@@ -99,3 +99,8 @@ Sugar supports multiple profiles, so that you can run multiple
instances with the same user. You can specify the name of the
profile with this option. A random generated one is added to
the config if you are running sugar-build under sugar.
+
+RUN_IN_WINDOW
+
+Set this variable to any value to run Sugar inside a window rather
+than fullscreen.
diff --git a/scripts/shell/start-sugar b/scripts/shell/start-sugar
index 2c8c186..701645b 100755
--- a/scripts/shell/start-sugar
+++ b/scripts/shell/start-sugar
@@ -9,4 +9,24 @@ if [ -f $rootdir/config ]; then
source $rootdir/config
fi
-xinit $scriptsdir/xinitrc -- $display
+if [ ! -z $SUGAR_PROFILE ]; then
+ grep -q PROFILE $ROOT_DIR/config
+ if [ $? -eq 1 ]; then
+ randomstring=`</dev/urandom tr -cd A-Za-z0-9 | head -c10`
+ echo "PROFILE=$randomstring" >> $ROOT_DIR/config
+ fi
+fi
+
+if [ -z $RUN_IN_WINDOW ]; then
+ xinit $scriptsdir/xinitrc -- $display
+else
+ xinit $scriptsdir/xinitrc -- /usr/bin/Xvnc $xvncdisplay -SecurityTypes None &
+ xvncpid=$!
+
+ xport=`echo $display | cut -c2-`
+ xvncport=$(($xport + 5800))
+ echo $xvncport
+ vncviewer localhost:$xvncport
+
+ kill $xvncpid
+fi