3 # Install Window Maker for the current user
7 if test x
"$1" = x
"--batch" ; then
14 # directory where system wide configuration is stored
15 GLOBALDIR
="#pkgdatadir#"
31 cat << EOF >> $ISCRIPT
32 # Window Maker default X session startup script
36 # If you login from xdm, uncomment this to make error messages appear
37 # in the console window.
39 # tail -f $HOME/.xsession-errors > /dev/console
49 # Copy files considering special cases
54 file=`basename $source`
56 if [ "$file" = "WMRootMenu" ]; then
57 echo \"$GSDIR/Library
/WindowMaker
/menu
\" > \
59 elif [ "$file" = "WindowMaker" ]; then
60 sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
62 if test "x$GNUSTEP_USER_ROOT" = "x"; then
63 sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
67 sed -e "s|~/GNUstep|$GSDIR|g" \
68 -e "s:#wmdatadir#:$GLOBALDIR:g" \
77 echo "Installing WindowMaker $VERSION for current user..."
80 if [ ! -d $GLOBALDIR ]; then
81 echo "Could not find global configurations files"
82 echo "Make sure you have installed Window Maker correctly"
86 if [ ! -d "$USERDIR" ]; then
87 echo "Could not find user directory $USERDIR"
92 if test "x$GNUSTEP_USER_ROOT" = "x"; then
94 GSDIR
=$USERDIR/GNUstep
95 if [ ! -d $GSDIR ]; then
96 echo "Creating $GSDIR user directory"
100 GSDIR
=$GNUSTEP_USER_ROOT
101 if [ ! -d $GSDIR ]; then
102 echo "Directory specified in GNUSTEP_USER_ROOT environment variable does not exist"
110 if [ ! -d "$GSDIR/.AppInfo" ]; then
111 make_dir
$GSDIR/.AppInfo
114 if [ ! -d "$GSDIR/Defaults" ]; then
115 make_dir
$GSDIR/Defaults
118 echo "Copying defaults database..."
120 FILES
=`(cd $GLOBALDIR/Defaults;ls *)`
124 if [ -f $GSDIR/Defaults
/$i -a -z "$BATCH" ]; then
126 echo "The configuration file \"$i\" already exists in your defaults database."
127 echo "Do you wish to replace it? <y/n/a> [n] $all"
128 if [ "$all" != "a" ]; then
130 if [ "$foo" = "a" -o "$foo" = "A" ]; then
134 if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; then
135 copy
$GLOBALDIR/Defaults
/$i $GSDIR/Defaults
/$i
138 copy
$GLOBALDIR/Defaults
/$i $GSDIR/Defaults
/$i
143 if [ ! -d "$GSDIR/Library/Icons/" ]; then
144 echo "Creating icon library directory $GSDIR/Library/Icons"
145 if [ ! -d $GSDIR/Library
]; then
146 make_dir
$GSDIR/Library
148 make_dir
$GSDIR/Library
/Icons
152 if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
153 echo "Creating WindowMaker data library directory $GSDIR/Library/WindowMaker"
154 if [ ! -d $GSDIR/Library
]; then
155 make_dir
$GSDIR/Library
157 make_dir
$GSDIR/Library
/WindowMaker
160 if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
161 echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
162 make_dir
$GSDIR/Library
/WindowMaker
/Styles
166 if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
167 echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
168 make_dir
$GSDIR/Library
/WindowMaker
/Themes
173 if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
174 echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
175 make_dir
$GSDIR/Library
/WindowMaker
/Backgrounds
177 echo "Default Backgrounds directory already exists. Skipping..."
181 if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
182 echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
183 make_dir
$GSDIR/Library
/WindowMaker
/IconSets
185 echo "Default IconSets directory already exists. Skipping..."
189 if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
190 echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
191 make_dir
$GSDIR/Library
/WindowMaker
/Pixmaps
193 echo "Default Pixmaps directory already exists. Skipping..."
197 if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
198 echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
199 make_dir
$GSDIR/Library
/WindowMaker
/Sounds
201 echo "Default Sounds directory already exists. Skipping..."
205 if [ ! -d "$GSDIR/Library/WindowMaker/SoundSets" ]; then
206 echo "Creating sound set library $GSDIR/Library/WindowMaker/SoundSets"
207 make_dir
$GSDIR/Library
/WindowMaker
/SoundSets
209 echo "Default SoundSets directory already exists. Skipping..."
213 if test -z "#LITE#" ; then
214 FILES
=`(cd $GLOBALDIR; ls menu menu.* plmenu plmenu.?? wmmacros)`
217 if [ -f "$GSDIR/Library/WindowMaker/$i" -a -z "$BATCH" ]; then
219 echo "The file \"$i\" already exists in $GSDIR/Library/WindowMaker"
220 echo "Do you wish to replace it? <y/n/a> [n] $all"
221 if [ "$all" != "a" ]; then
223 if [ "$foo" = "a" -o "$foo" = "A" ]; then
227 if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
228 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
231 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
236 cp $GLOBALDIR/README.themes
$GSDIR/Library
/WindowMaker
237 cp $GLOBALDIR/README
$GSDIR/Library
/WindowMaker
239 if test -n "$BATCH"; then
240 test -f ~
$GSDIR/Library
/WindowMaker
/autostart || \
241 cp $GLOBALDIR/autostart.sh
$GSDIR/Library
/WindowMaker
/autostart
242 chmod +rx
$GSDIR/Library
/WindowMaker
/autostart
243 test -f ~
$GSDIR/Library
/WindowMaker
/exitscript || \
244 cp $GLOBALDIR/exitscript.sh
$GSDIR/Library
/WindowMaker
/exitscript
245 chmod +rx
$GSDIR/Library
/WindowMaker
/exitscript
247 cp -i $GLOBALDIR/autostart.sh
$GSDIR/Library
/WindowMaker
/autostart
248 chmod +rx
$GSDIR/Library
/WindowMaker
/autostart
249 cp -i $GLOBALDIR/exitscript.sh
$GSDIR/Library
/WindowMaker
/exitscript
250 chmod +rx
$GSDIR/Library
/WindowMaker
/exitscript
255 if test -n "$BATCH" ; then
256 echo "Installation Finished"
263 #######################
265 DATE
=`date +%m%d%H%M`
270 echo "Installation Finished"
272 if test -z "#LITE#" ; then
273 echo "There are menus in 2 different file formats. The plain text format and"
274 echo "the property list format. The plain text format is more flexible, but"
275 echo "the menu in the property list format can be edited graphically. The"
276 echo "menu that will be used by default is the plain text. Read"
277 echo "$GSDIR/Library/WindowMaker/README for information on how to change it."
279 echo "Your copy of Window Maker is configured especially for KDE."
280 echo "Window Maker application menus are not available."
285 for xinit
in .xinitrc .Xclients .xsession
; do
286 test ! -f "$HOME/$xinit" && continue
287 test -z "`grep wmaker $HOME/$xinit`"
288 [ $?
-eq 0 ] && wmaker_found
=0
290 [ $wmaker_found -eq 1 ] && show_end_message
&& exit 0
293 trap "show_end_message;exit" 2
296 echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
297 echo "it calls wmaker when you start an X session."
298 echo "Type the name of the file that must be changed (normally .xinitrc)."
299 echo "If the file already exists, it will be backed up with a .old.$DATE extension"
300 echo "If you want to edit it by hand, hit <Control>-C now."
303 if test "x$file" = "x"; then
304 echo "Using .xinitrc as a default value"
308 if [ -f $USERDIR/$file ]; then
309 mv $USERDIR/$file $USERDIR/$file.old.
$DATE
312 make_script
$USERDIR/$file