3 # Install Window Maker for the current user
6 # directory where system wide configuration is stored
7 GLOBALDIR
="#pkgdatadir#"
23 cat << EOF >> $ISCRIPT
24 # Window Maker default X session startup script
28 # If you login from xdm, uncomment this to make error messages appear
29 # in the console window.
31 # tail -f $HOME/.xsession-errors > /dev/console
41 # Copy files considering special cases
46 file=`basename $source`
48 if [ "$file" = "WMRootMenu" ]; then
49 echo \"$GSDIR/Library
/WindowMaker
/menu
\" > \
51 elif [ "$file" = "WindowMaker" ]; then
52 sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
54 if test "x$GNUSTEP_USER_ROOT" = "x"; then
57 sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
64 echo "Installing WindowMaker $VERSION for current user..."
67 if [ ! -d $GLOBALDIR ]; then
68 echo "Could not find global configurations files"
69 echo "Make sure you've installed Window Maker correctly"
73 if [ ! -d "$USERDIR" ]; then
74 echo "Could not find user directory $USERDIR"
79 if test "x$GNUSTEP_USER_ROOT" = "x"; then
81 GSDIR
=$USERDIR/GNUstep
82 if [ ! -d $GSDIR ]; then
83 echo "Creating $GSDIR user directory"
87 GSDIR
=$GNUSTEP_USER_ROOT
88 if [ ! -d $GSDIR ]; then
89 echo "Directory specified in GNUSTEP_USER_ROOT environment variable does not exist"
97 if [ ! -d "$GSDIR/.AppInfo" ]; then
98 make_dir
$GSDIR/.AppInfo
101 if [ ! -d "$GSDIR/Defaults" ]; then
102 make_dir
$GSDIR/Defaults
105 echo "Copying defaults database..."
107 FILES
=`(cd $GLOBALDIR/Defaults;ls *)`
110 if [ -f $GSDIR/Defaults
/$i ]; then
111 echo "The configuration file \"$i\" already exists in your defaults database."
112 echo "Do you wish to replace it? <y/n/a> [n] $all"
113 if [ "$all" != "a" ]; then
115 if [ "$foo" = "a" -o "$foo" = "A" ]; then
119 if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; then
120 copy
$GLOBALDIR/Defaults
/$i $GSDIR/Defaults
/$i
123 copy
$GLOBALDIR/Defaults
/$i $GSDIR/Defaults
/$i
128 if [ ! -d "$GSDIR/Library/Icons/" ]; then
129 echo "Creating icon library directory $GSDIR/Library/Icons"
130 if [ ! -d $GSDIR/Library
]; then
131 make_dir
$GSDIR/Library
133 make_dir
$GSDIR/Library
/Icons
137 if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
138 echo "Creating WindowMaker data library directory $GSDIR/Library/WindowMaker"
139 if [ ! -d $GSDIR/Library
]; then
140 make_dir
$GSDIR/Library
142 make_dir
$GSDIR/Library
/WindowMaker
145 if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
146 echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
147 make_dir
$GSDIR/Library
/WindowMaker
/Styles
149 echo "Styles directory already exists. Skipping..."
153 if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
154 echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
155 make_dir
$GSDIR/Library
/WindowMaker
/Themes
157 echo "Themes directory already exists. Skipping..."
161 if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
162 echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
163 make_dir
$GSDIR/Library
/WindowMaker
/Backgrounds
165 echo "Default Backgrounds directory already exists. Skipping..."
169 if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
170 echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
171 make_dir
$GSDIR/Library
/WindowMaker
/IconSets
173 echo "Default IconSets directory already exists. Skipping..."
177 if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
178 echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
179 make_dir
$GSDIR/Library
/WindowMaker
/Pixmaps
181 echo "Default Pixmaps directory already exists. Skipping..."
185 if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
186 echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
187 make_dir
$GSDIR/Library
/WindowMaker
/Sounds
189 echo "Default Sounds directory already exists. Skipping..."
193 if [ ! -d "$GSDIR/Library/WindowMaker/SoundSets" ]; then
194 echo "Creating sound set library $GSDIR/Library/WindowMaker/SoundSets"
195 make_dir
$GSDIR/Library
/WindowMaker
/SoundSets
197 echo "Default SoundSets directory already exists. Skipping..."
201 echo "Copying default menu configuration files..."
202 FILES
=`(cd $GLOBALDIR;ls -1 menu* plmenu wmmacros)`
205 if [ -f "$GSDIR/Library/WindowMaker/$i" ]; then
206 echo "The file \"$i\" already exists in $GSDIR/Library/WindowMaker"
207 echo "Do you wish to replace it? <y/n/a> [n] $all"
208 if [ "$all" != "a" ]; then
210 if [ "$foo" = "a" -o "$foo" = "A" ]; then
214 if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
215 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
218 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
223 cp $GLOBALDIR/README
$GSDIR/Library
/WindowMaker
224 cp -i $GLOBALDIR/autostart.sh
$GSDIR/Library
/WindowMaker
/autostart
225 chmod +rx
$GSDIR/Library
/WindowMaker
/autostart
228 #######################
230 DATE
=`date +%m%d%H%M`
235 echo "Installation Finished"
237 echo "There are menus in 2 different file formats. The plain text format and"
238 echo "the property list format. The plain text format is more flexible, but"
239 echo "the menu in the property list format can be edited graphically. The"
240 echo "menu that will be used by default is the plain text. Read"
241 echo "$GSDIR/Library/WindowMaker/README for information on how to change it."
246 trap "show_end_message;exit" 2
249 echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
250 echo "it calls wmaker when you start an X session."
251 echo "Type the name of the file that must be changed (normally .xinitrc)."
252 echo "If the file already exists, it will be backed up with a .old.$DATE extension"
253 echo "If you want to edit it by hand, hit <Control>-C now."
256 if test "x$file" = "x"; then
257 echo "Using .xinitrc as a default value"
261 if [ -f $USERDIR/$file ]; then
262 mv $USERDIR/$file $USERDIR/$file.old.
$DATE
265 make_script
$USERDIR/$file