Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-08-02 18:27:31 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-08-02 18:27:31 (GMT)
commitde4fea23a6c945010287fee202a7215dd2f61c47 (patch)
tree2d40f57675b9ab7c714c431ebf5748ddd88483ac /scripts
parentb94013a5e78aedbb537e1ffe43e5b41e98e6ad62 (diff)
Add RUN_IN_WINDOW option
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/shell/start-sugar22
1 files changed, 21 insertions, 1 deletions
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