3 # Install Window Maker for the current user
7 if test "x$1" = "x--batch" ; then
14 # name of menu file we install (menu, plmenu)
18 if [ -z "$LOCALE" ]; then
22 # directory where system wide configuration is stored
23 GLOBALDIR
="#pkgdatadir#"
24 GLOBALDEFDIR
="#sysconfdir#"
40 cat << EOF >> $ISCRIPT
41 # Window Maker default X session startup script
45 # If you login from xdm, uncomment this to make error messages appear
46 # in the console window.
48 # tail -f $HOME/.xsession-errors > /dev/console &
58 # Copy files considering special cases
63 file=`basename $source`
65 if [ "$file" = "WindowMaker" ]; then
66 sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
67 elif [ "$file" = "WMRootMenu" ]; then
68 if [ "$LOCALE" ]; then
69 if [ -f $GLOBALDIR/plmenu.
$LOCALE ]; then
70 source=$GLOBALDIR/plmenu.
$LOCALE
71 elif [ -f $GLOBALDIR/plmenu.
${LOCALE%.*} ]; then
72 source=$GLOBALDIR/plmenu.
${LOCALE%.*}
73 elif [ -f $GLOBALDIR/plmenu.
${LOCALE%_*} ]; then
74 source=$GLOBALDIR/plmenu.
${LOCALE%_*}
75 elif [ -f $GLOBALDIR/menu.
${LOCALE%_*} ]; then
76 source=$GLOBALDIR/menu.
${LOCALE%_*}
78 source=$GLOBALDIR/plmenu
81 source=$GLOBALDIR/plmenu
83 sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
84 $source > $GSDIR/Defaults
/WMRootMenu
86 if test "x$GNUSTEP_USER_ROOT" = "x"; then
87 sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
90 sed -e "s|\$HOME/GNUstep|$GSDIR|g" \
91 -e "s:#wmdatadir#:$GLOBALDIR:g" \
99 echo "Installing WindowMaker $VERSION for current user..."
102 if [ ! -d $GLOBALDIR ]; then
103 echo "Could not find global data files"
104 echo "Make sure you have installed Window Maker correctly"
108 if [ ! -d $GLOBALDEFDIR ]; then
109 echo "Could not find global configurations files"
110 echo "Make sure you have installed Window Maker correctly"
114 if [ ! -d "$USERDIR" ]; then
115 echo "Could not find user directory $USERDIR"
120 if test "x$GNUSTEP_USER_ROOT" = "x"; then
122 GSDIR
=$USERDIR/GNUstep
123 if [ ! -d $GSDIR ]; then
124 echo "Creating $GSDIR user directory"
128 GSDIR
=$GNUSTEP_USER_ROOT
129 if [ ! -d $GSDIR ]; then
130 echo "Directory specified in GNUSTEP_USER_ROOT environment variable does not exist"
138 if [ ! -d "$GSDIR/.AppInfo" ]; then
139 make_dir
$GSDIR/.AppInfo
142 if [ ! -d "$GSDIR/Defaults" ]; then
143 make_dir
$GSDIR/Defaults
146 echo "Copying defaults database..."
148 FILES
=`(cd $GLOBALDEFDIR;ls -d *)`
151 if [ ! -d $GLOBALDEFDIR/$i ]; then
152 if [ -f $GSDIR/Defaults
/$i -a -z "$BATCH" ]; then
153 echo "The configuration file \"$i\" already exists in your defaults database."
154 echo "Do you wish to replace it? <y/n/a> [n] $all"
155 if [ "$all" != "a" ]; then
157 if [ "$foo" = "a" -o "$foo" = "A" ]; then
161 if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; then
162 copy
$GLOBALDEFDIR/$i $GSDIR/Defaults
/$i
165 copy
$GLOBALDEFDIR/$i $GSDIR/Defaults
/$i
171 if [ ! -d "$GSDIR/Library/Icons/" ]; then
172 echo "Creating icon library directory $GSDIR/Library/Icons"
173 if [ ! -d $GSDIR/Library
]; then
174 make_dir
$GSDIR/Library
176 make_dir
$GSDIR/Library
/Icons
180 if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
181 echo "Creating WindowMaker data library directory $GSDIR/Library/WindowMaker"
182 if [ ! -d $GSDIR/Library
]; then
183 make_dir
$GSDIR/Library
185 make_dir
$GSDIR/Library
/WindowMaker
188 if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
189 echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
190 make_dir
$GSDIR/Library
/WindowMaker
/Styles
194 if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
195 echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
196 make_dir
$GSDIR/Library
/WindowMaker
/Themes
201 if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
202 echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
203 make_dir
$GSDIR/Library
/WindowMaker
/Backgrounds
205 echo "Default Backgrounds directory already exists. Skipping..."
209 if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
210 echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
211 make_dir
$GSDIR/Library
/WindowMaker
/IconSets
213 echo "Default IconSets directory already exists. Skipping..."
217 if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
218 echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
219 make_dir
$GSDIR/Library
/WindowMaker
/Pixmaps
221 echo "Default Pixmaps directory already exists. Skipping..."
225 if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
226 echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
227 make_dir
$GSDIR/Library
/WindowMaker
/Sounds
229 echo "Default Sounds directory already exists. Skipping..."
233 if [ ! -d "$GSDIR/Library/WindowMaker/SoundSets" ]; then
234 echo "Creating sound set library $GSDIR/Library/WindowMaker/SoundSets"
235 make_dir
$GSDIR/Library
/WindowMaker
/SoundSets
237 echo "Default SoundSets directory already exists. Skipping..."
241 if test -z "#LITE#" ; then
242 FILES
=`(cd $GLOBALDIR; ls menu menu.* plmenu plmenu.?? wmmacros)`
245 if [ -f "$GSDIR/Library/WindowMaker/$i" -a -z "$BATCH" ]; then
247 echo "The file \"$i\" already exists in $GSDIR/Library/WindowMaker"
248 echo "Do you wish to replace it? <y/n/a> [n] $all"
249 if [ "$all" != "a" ]; then
251 if [ "$foo" = "a" -o "$foo" = "A" ]; then
255 if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
256 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
259 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
264 cp $GLOBALDIR/README.themes
$GSDIR/Library
/WindowMaker
265 cp $GLOBALDIR/README
$GSDIR/Library
/WindowMaker
267 test -f ~
$GSDIR/Library
/WindowMaker
/autostart || \
268 cp $GLOBALDIR/autostart.sh
$GSDIR/Library
/WindowMaker
/autostart
269 chmod +rx
$GSDIR/Library
/WindowMaker
/autostart
271 test -f ~
$GSDIR/Library
/WindowMaker
/exitscript || \
272 cp $GLOBALDIR/exitscript.sh
$GSDIR/Library
/WindowMaker
/exitscript
273 chmod +rx
$GSDIR/Library
/WindowMaker
/exitscript
276 if test -n "$BATCH" ; then
277 echo "Installation Finished"
284 #######################
291 echo "Installation Finished"
293 if test -z "#LITE#" ; then
294 echo "There are menus in 2 different file formats. The plain text format and"
295 echo "the property list format. The plain text format is more flexible, but"
296 echo "the menu in the property list format can be edited graphically. The"
297 echo "menu that will be used by default is the property list one. Read"
298 echo " $GSDIR/Library/WindowMaker/README"
299 echo "for information on how to change it."
300 if [ "${inst_menu%.*}" = "menu" ]; then
301 echo "However, since you have locale set to $LOCALE and plmenu for such locale"
302 echo "was not found, your WMRootMenu contains path to text formated menu:"
303 echo " $GSDIR/Library/WindowMaker/$inst_menu"
306 echo "Your copy of Window Maker is configured especially for KDE."
307 echo "Window Maker application menus are not available."
312 for xinit
in .xinitrc .Xclients .xsession
; do
313 test ! -f "$HOME/$xinit" && continue
314 res
="`grep wmaker $HOME/$xinit`"
315 if test "x$res" != x
; then
320 if test $wmaker_found = 1; then
321 echo "Found Window Maker to already be your default window manager."
327 trap "show_end_message;exit" 2
330 echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
331 echo "it calls wmaker when you start an X session."
332 echo "Type the name of the file that must be changed (normally .xinitrc)."
333 echo "If the file already exists, it will be backed up with a .old.$DATE "
335 echo "If you want to edit it by hand, hit <Control>-C now."
338 if test "x$file" = "x"; then
339 echo "Using .xinitrc as a default value"
343 if [ -f $USERDIR/$file ]; then
344 mv $USERDIR/$file $USERDIR/$file.old.
$DATE
347 make_script
$USERDIR/$file