Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin/sugar.in
blob: 12768a5bb211d1302575014100289dd870d231ce (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

usage() {
    cat <<EOF
Usage: sugar [OPTION]..

Start Sugar window manager.

Optional arguments.
  -d, --display DISPLAY     Display to start sugar
  -s, --scaling SCALING     Scale Sugar theme
                            Supported values: 72, 100
EOF
    exit 0
}

while [ $# -ne 0 ] ; do
    case "$1" in
      	-d | --display)
            shift
            export DISPLAY="$1"
            ;;
      	-s | --scaling)
            shift
            export SUGAR_SCALING="$1"
            ;;
      	-h | --help)
            usage
            ;;
    esac
    shift
done

if test -z "$SUGAR_SCALING"; then
    export SUGAR_SCALING=72
fi

export GTK2_RC_FILES="@prefix@/share/sugar/data/sugar-$SUGAR_SCALING.gtkrc"

# Needed for executing wpa_passphrase
export PATH="$PATH":/sbin:/usr/sbin

if ! test -f "$GTK2_RC_FILES"; then
    echo "sugar: ERROR: Gtk theme for scaling $SUGAR_SCALING not available in path $GTK2_RC_FILES"
    exit 1
fi

# Set default language
export LANG="en_US.utf8"
export LANGUAGE="en_US.utf8"

# Source language settings and debug definitions
if [ -f ~/.i18n ]; then
        . ~/.i18n
fi
if [ -f ~/.sugar/debug ]; then
        . ~/.sugar/debug
fi

echo Xcursor.theme: sugar | xrdb -merge
metacity --no-force-fullscreen -d $DISPLAY &

exec sugar-session