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#"
16 GLOBALDEFDIR
="#sysconfdir#"
32 cat << EOF >> $ISCRIPT
33 # Window Maker default X session startup script
37 # If you login from xdm, uncomment this to make error messages appear
38 # in the console window.
40 # tail -f $HOME/.xsession-errors > /dev/console &
50 # Copy files considering special cases
55 file=`basename $source`
57 if [ "$file" = "WindowMaker" ]; then
58 sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
60 if test "x$GNUSTEP_USER_ROOT" = "x"; then
61 sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
64 sed -e "s|\$HOME/GNUstep|$GSDIR|g" \
65 -e "s:#wmdatadir#:$GLOBALDIR:g" \
73 echo "Installing WindowMaker $VERSION for current user..."
76 if [ ! -d $GLOBALDIR ]; then
77 echo "Could not find global data files"
78 echo "Make sure you have installed Window Maker correctly"
82 if [ ! -d $GLOBALDEFDIR ]; then
83 echo "Could not find global configurations files"
84 echo "Make sure you have installed Window Maker correctly"
88 if [ ! -d "$USERDIR" ]; then
89 echo "Could not find user directory $USERDIR"
94 if test "x$GNUSTEP_USER_ROOT" = "x"; then
96 GSDIR
=$USERDIR/GNUstep
97 if [ ! -d $GSDIR ]; then
98 echo "Creating $GSDIR user directory"
102 GSDIR
=$GNUSTEP_USER_ROOT
103 if [ ! -d $GSDIR ]; then
104 echo "Directory specified in GNUSTEP_USER_ROOT environment variable does not exist"
112 if [ ! -d "$GSDIR/.AppInfo" ]; then
113 make_dir
$GSDIR/.AppInfo
116 if [ ! -d "$GSDIR/Defaults" ]; then
117 make_dir
$GSDIR/Defaults
120 echo "Copying defaults database..."
122 FILES
=`(cd $GLOBALDEFDIR;ls -d *)`
125 if [ ! -d $GLOBALDEFDIR/$i ]; then
126 if [ -f $GSDIR/Defaults
/$i -a -z "$BATCH" ]; then
127 echo "The configuration file \"$i\" already exists in your defaults database."
128 echo "Do you wish to replace it? <y/n/a> [n] $all"
129 if [ "$all" != "a" ]; then
131 if [ "$foo" = "a" -o "$foo" = "A" ]; then
135 if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; then
136 copy
$GLOBALDEFDIR/$i $GSDIR/Defaults
/$i
139 copy
$GLOBALDEFDIR/$i $GSDIR/Defaults
/$i
145 if [ ! -d "$GSDIR/Library/Icons/" ]; then
146 echo "Creating icon library directory $GSDIR/Library/Icons"
147 if [ ! -d $GSDIR/Library
]; then
148 make_dir
$GSDIR/Library
150 make_dir
$GSDIR/Library
/Icons
154 if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
155 echo "Creating WindowMaker data library directory $GSDIR/Library/WindowMaker"
156 if [ ! -d $GSDIR/Library
]; then
157 make_dir
$GSDIR/Library
159 make_dir
$GSDIR/Library
/WindowMaker
162 if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
163 echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
164 make_dir
$GSDIR/Library
/WindowMaker
/Styles
168 if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
169 echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
170 make_dir
$GSDIR/Library
/WindowMaker
/Themes
175 if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
176 echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
177 make_dir
$GSDIR/Library
/WindowMaker
/Backgrounds
179 echo "Default Backgrounds directory already exists. Skipping..."
183 if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
184 echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
185 make_dir
$GSDIR/Library
/WindowMaker
/IconSets
187 echo "Default IconSets directory already exists. Skipping..."
191 if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
192 echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
193 make_dir
$GSDIR/Library
/WindowMaker
/Pixmaps
195 echo "Default Pixmaps directory already exists. Skipping..."
199 if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
200 echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
201 make_dir
$GSDIR/Library
/WindowMaker
/Sounds
203 echo "Default Sounds directory already exists. Skipping..."
207 if [ ! -d "$GSDIR/Library/WindowMaker/SoundSets" ]; then
208 echo "Creating sound set library $GSDIR/Library/WindowMaker/SoundSets"
209 make_dir
$GSDIR/Library
/WindowMaker
/SoundSets
211 echo "Default SoundSets directory already exists. Skipping..."
215 if test -z "#LITE#" ; then
216 FILES
=`(cd $GLOBALDIR; ls menu menu.* plmenu plmenu.?? wmmacros)`
219 if [ -f "$GSDIR/Library/WindowMaker/$i" -a -z "$BATCH" ]; then
221 echo "The file \"$i\" already exists in $GSDIR/Library/WindowMaker"
222 echo "Do you wish to replace it? <y/n/a> [n] $all"
223 if [ "$all" != "a" ]; then
225 if [ "$foo" = "a" -o "$foo" = "A" ]; then
229 if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
230 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
233 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
238 cp $GLOBALDIR/README.themes
$GSDIR/Library
/WindowMaker
239 cp $GLOBALDIR/README
$GSDIR/Library
/WindowMaker
241 test -f ~
$GSDIR/Library
/WindowMaker
/autostart || \
242 cp $GLOBALDIR/autostart.sh
$GSDIR/Library
/WindowMaker
/autostart
243 chmod +rx
$GSDIR/Library
/WindowMaker
/autostart
245 test -f ~
$GSDIR/Library
/WindowMaker
/exitscript || \
246 cp $GLOBALDIR/exitscript.sh
$GSDIR/Library
/WindowMaker
/exitscript
247 chmod +rx
$GSDIR/Library
/WindowMaker
/exitscript
250 if test -n "$BATCH" ; then
251 echo "Installation Finished"
258 #######################
265 echo "Installation Finished"
267 if test -z "#LITE#" ; then
268 echo "There are menus in 2 different file formats. The plain text format and"
269 echo "the property list format. The plain text format is more flexible, but"
270 echo "the menu in the property list format can be edited graphically. The"
271 echo "menu that will be used by default is the property list one. Read"
272 echo "$GSDIR/Library/WindowMaker/README for information on how to change it."
274 echo "Your copy of Window Maker is configured especially for KDE."
275 echo "Window Maker application menus are not available."
280 for xinit
in .xinitrc .Xclients .xsession
; do
281 test ! -f "$HOME/$xinit" && continue
282 res
="`grep wmaker $HOME/$xinit`"
283 if test "x$res" != x
; then
288 if test $wmaker_found = 1; then
289 echo "Found Window Maker to already be your default window manager."
295 trap "show_end_message;exit" 2
298 echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
299 echo "it calls wmaker when you start an X session."
300 echo "Type the name of the file that must be changed (normally .xinitrc)."
301 echo "If the file already exists, it will be backed up with a .old.$DATE "
303 echo "If you want to edit it by hand, hit <Control>-C now."
306 if test "x$file" = "x"; then
307 echo "Using .xinitrc as a default value"
311 if [ -f $USERDIR/$file ]; then
312 mv $USERDIR/$file $USERDIR/$file.old.
$DATE
315 make_script
$USERDIR/$file