source: trunk/dports/gnustep/gnustep/files/config-gnustep-user.sh @ 41060

Last change on this file since 41060 was 26824, checked in by yves@…, 13 years ago

change devel variant to dev_tools

  • Property svn:eol-style set to native
File size: 5.0 KB
Line 
1#!/bin/sh
2
3# some fancy term output methods
4have_tput=true
5if [ $TERM = "vt100" ]
6        then
7        t_bold="tput smso"
8        t_norm="tput rmso"
9elif `echo $TERM | grep -q xterm`
10        then
11        t_bold="tput bold"
12        t_norm="tput sgr0"
13else
14        have_tput=false
15fi
16if $have_tput
17        then
18        t_clear="tput clear"
19        $t_clear
20fi
21
22$t_clear
23
24. /opt/local/GNUstep/System/Library/Makefiles/GNUstep.sh
25
26$t_bold
27echo
28echo "Welcome to the G E C H S C U"
29$t_norm
30echo
31echo "(GNUstep environment configuration helper script for the common user)"
32
33sleep 2
34
35echo
36echo
37
38echo 'You can enter your language right now or '
39echo -n '"list" for a list of supported languages or "enter" to continue : '
40read
41gs_lang=${REPLY:-false}
42if [ $gs_lang = "list" ]
43    then
44    $t_clear
45    ls "$GNUSTEP_SYSTEM_ROOT/Library/Libraries/gnustep-base/Versions/1.14/Resources/Languages" | grep -v Locale
46    echo
47    echo -n 'you can enter a name right now or "enter" to continue : '
48    read
49    gs_lang=${REPLY:-false}
50fi
51if [ $gs_lang != false ]
52    then
53    $t_bold
54    if [ ! -f $GNUSTEP_SYSTEM_ROOT/Library/Libraries/gnustep-base/Versions/1.14/Resources/Languages/$gs_lang ]
55        then
56        echo "$gs_lang is not a language supported by GNUstep"
57        gs_lang=false
58    else
59        echo "GNUstep language = $gs_lang"
60    fi
61    $t_norm
62    echo
63    if [ -z $LANG ] && [ -d /usr/share/locale ]
64        then
65        echo
66        echo 'You should also set your LANG environment before running this script'
67        echo
68        echo 'You can enter "list" for a hint and exit or "enter" to continue : '
69        read
70        sh_lang=${REPLY:-false}
71        if [ $sh_lang = "list" ]
72            then
73            $t_clear
74            echo "Language codes available for LANG :"
75            echo
76            ls /usr/share/locale
77            echo
78            echo "For example, you can set your LANG environment by adding"
79            echo "export LANG=fr_CA.UTF-8"
80            echo "export LC_ALL=fr_CA.UTF-8"
81            echo "to your ~/.profile"
82            echo "if you use the French language"
83            echo
84            exit 1
85        fi
86    fi
87fi
88
89
90#
91# ask for timezone
92#
93echo
94echo
95echo "Please enter your timezone"
96echo -n 'or type "list" for a list of available zones or "enter" : '
97read
98zone=${REPLY:-false}
99if [ $zone != false ]
100    then
101    if [ $zone = "list" ]
102        then
103        cat $GNUSTEP_SYSTEM_ROOT/Library/Libraries/gnustep-base/Versions/1.14/Resources/NSTimeZones/regions | awk '{print $2}' | more
104        echo
105        echo -n 'you can enter timezone right now or "enter" to continue : '
106        read
107        zone=${REPLY:-false}
108    fi
109fi
110if [ $zone != false ]
111    then
112    $t_bold
113    if ! `grep -q " $zone\$" $GNUSTEP_SYSTEM_ROOT/Library/Libraries/gnustep-base/Versions/1.14/Resources/NSTimeZones/regions`
114        then
115        echo "$zone is not a recognized region name"
116        zone=false
117    else
118        echo Timezone = $zone
119    fi
120    $t_norm
121fi
122
123echo
124echo
125
126if [ ! -d $GNUSTEP_USER_ROOT/Library/WindowMaker ]
127    then
128    echo -n "Installing WindowMaker resources ... "
129    mkdir $GNUSTEP_USER_ROOT
130    wmaker.inst
131    echo "Done"
132fi
133echo "Setting AntiAliased text in WindowMaker"
134def=$GNUSTEP_USER_ROOT/Defaults/WindowMaker
135sed '/AntialiasedText/ s/NO/YES/' $def > $def.new
136mv -f $def.new $def
137
138echo
139echo
140
141echo "Setting some GNUstep environment defaults ... "
142sleep 2
143echo "System fonts    : Bitstream Vera"
144gdefaults write NSGlobalDomain NSFont 'BitstreamVeraSans-Roman'
145gdefaults write NSGlobalDomain NSBoldFont 'BitstreamVeraSans-Bold'
146gdefaults write NSGlobalDomain NSItalicFont 'BitstreamVeraSans-Oblique'
147gdefaults write NSGlobalDomain NSBoldItalicFont 'BitstreamVeraSans-BoldOblique'
148gdefaults write NSGlobalDomain NSUserFixedPitchFont 'BitstreamVeraSansMono-Roman'
149sleep 2
150echo "Font size       : 10"
151gdefaults write NSGlobalDomain NSFontSize '10'
152
153if [ $gs_lang != false ]
154    then
155    sleep 2
156    echo "Language        : $gs_lang"
157    gdefaults write NSGlobalDomain Language "($gs_lang)"
158fi
159
160if [ $zone != false ]
161    then
162    sleep 2
163    echo "Local Time Zone : $zone"
164    gdefaults write NSGlobalDomain "Local Time Zone" $zone
165fi
166
167sleep 2
168echo "XShm            : disabled"
169gdefaults write NSGlobalDomain XWindowBufferUseXShm NO
170
171sleep 2
172bundledir="$GNUSTEP_SYSTEM_ROOT/Library/Bundles"
173echo "Resetting       : GSAppKitUserBundles (in NSGlobalDomain)"
174gdefaults write NSGlobalDomain GSAppKitUserBundles "($bundledir/Camaelon.themeEngine, $bundledir/EtoileMenus.bundle, $bundledir/EtoileBehavior.bundle)"
175sleep 2
176echo "Setting         : User Interface Theme to Nesedah (in Camaelon domain)"
177gdefaults write Camaelon Theme Nesedah
178
179gdefaults write GWorkspace NoWarnOnQuit YES
180gdefaults write NSGlobalDomain GSWorkspaceApplication "NotExist.app"
181
182echo
183
184sleep 2
185echo
186echo "All done !"
187
188
189sleep 2
190echo
191echo "Note that even though the GNUstep environment is set"
192sleep 2
193echo "You may need to reset it if you experience DYLD errors when trying to start a GNUstep app"
194sleep 2
195echo "You can do so with '. $GNUSTEP_SYSTEM_ROOT/Library/Makefiles/GNUstep.sh'"
196sleep 2
197
198echo
199echo
200echo "Have a nice day !"
201
202echo
203echo
Note: See TracBrowser for help on using the repository browser.