Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/scripts/shell/start-sugar
blob: 5408a4319ec0d9ab64d3e33e9c2346037e59aeea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

shelldir=`dirname "$0"`
scriptsdir=`dirname "$shelldir"`
rootdir=`dirname "$scriptsdir"`
display=`$scriptsdir/find-free-display`

if [ -f $rootdir/config ]; then
  source $rootdir/config
fi

if [ ! -z $SUGAR_PROFILE ]; then
    grep -q PROFILE $rootdir/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/Xephyr $display
fi