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

Last change on this file since 17790 was 17790, checked in by yves, 15 years ago

Bug: 8139
Submitted by:
Reviewed by:
Approved by:
Obtained from:

ArtResources, Gorm, ProjectCenter, gworkspace and gnustep META ports

  • Property svn:eol-style set to native
File size: 3.9 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. @PREFIX@/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 name 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 "@PREFIX@/GNUstep/System/Library/Libraries/Resources/gnustep-base/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 ; echo "GNUstep language = $gs_lang" ; $t_norm
54        echo
55        if [ -z $LANG ] && [ -d @PREFIX@/share/locale ]
56           then
57           echo
58           echo 'You should also set your LANG environment before running this script'
59           echo
60           echo 'You can enter "list" for a hint and exit or "enter" to continue : '
61       read
62       sh_lang=${REPLY:-false}
63       if [ $sh_lang = "list" ]
64        then
65        $t_clear
66        echo "Language codes available for LANG :"
67        echo
68        ls @PREFIX@/share/locale
69        echo
70        echo "For example, you can set your LANG environment by adding"
71        echo "export LANG=fr"
72        echo "to your ~/.profile"
73        echo "if you use the French language"
74        echo
75        exit 1
76       fi
77    fi
78fi
79
80
81#
82# ask for timezone
83#
84echo
85echo
86echo "Please enter your timezone"
87echo -n 'or type "list" for a list of available zones or "enter" : '
88read
89zone=${REPLY:-false}
90if [ $zone != false ]
91        then
92        if [ $zone = "list" ]
93                then
94                cat @PREFIX@/GNUstep/System/Library/Libraries/Resources/gnustep-base/NSTimeZones/regions | awk '{print $2}' | more
95                echo
96                echo -n 'you can enter timezone right now or "enter" to continue : '
97                read
98                zone=${REPLY:-false}
99        fi
100fi
101if [ $zone != false ]
102        then
103        $t_bold
104        if ! `grep -q $zone @PREFIX@/GNUstep/System/Library/Libraries/Resources/gnustep-base/NSTimeZones/regions`
105                then
106                echo "$zone is not a recognized region name"
107                zone=false
108        else
109                echo Timezone = $zone
110        fi
111        $t_norm
112fi
113
114echo
115echo
116
117if [ ! -d $HOME/GNUstep/Library/WindowMaker ]
118        then
119        echo -n "Installing WindowMaker resources ... "
120        wmaker.inst
121        echo "Done"
122fi
123echo "Setting AntiAliased text in WindowMaker"
124def=$HOME/GNUstep/Defaults/WindowMaker
125sed '/AntialiasedText/ s/NO/YES/' $def > $def.new
126mv -f $def.new $def
127
128echo
129echo
130
131echo "Setting some GNUstep environment defaults ... "
132sleep 2
133echo "System fonts    : Bitstream Vera"
134gdefaults write NSGlobalDomain NSFont 'BitstreamVeraSans-Roman'
135gdefaults write NSGlobalDomain NSBoldFont 'BitstreamVeraSans-Bold'
136gdefaults write NSGlobalDomain NSItalicFont 'BitstreamVeraSans-Oblique'
137gdefaults write NSGlobalDomain NSBoldItalicFont 'BitstreamVeraSans-BoldOblique'
138gdefaults write NSGlobalDomain NSUserFixedPitchFont 'BitstreamVeraSansMono-Roman'
139sleep 2
140echo "Font size       : 10"
141gdefaults write NSGlobalDomain NSFontSize '10'
142
143if [ $zone != false ]
144        then
145        sleep 2
146    echo "Local Time Zone : $zone"
147        gdefaults write NSGlobalDomain "Local Time Zone" $zone
148fi
149
150if [ $gs_lang != false ]
151        then
152        sleep 2
153    echo "Language        : $gs_lang"
154        gdefaults write NSGlobalDomain Language $gs_lang
155fi
156sleep 2
157echo "XShm            : disabled"
158gdefaults write NSGlobalDomain XWindowBufferUseXShm NO
159
160sleep 2
161echo
162echo "All done !"
163
164
165sleep 2
166echo
167echo "Note that even though the GNUstep environment is set"
168sleep 2
169echo "You may need to reset it if you experience DYLD errors when trying to start a GNUstep app"
170sleep 2
171echo "You can do so with '. @PREFIX@/GNUstep/System/Library/Makefiles/GNUstep.sh'"
172sleep 2
173
174echo
175echo
176echo "Have a nice day !"
177
178echo
179echo
Note: See TracBrowser for help on using the repository browser.