3 # Install Window Maker for the current user
7 if test x
"$1" = x
"--batch" ; then
16 if [ -z "$LOCALE" ]; then
20 # directory where system wide configuration is stored
21 GLOBALDIR
="#pkgdatadir#"
22 GLOBALDEFDIR
="#sysconfdir#"
38 cat << EOF >> $ISCRIPT
39 # Window Maker default X session startup script
43 # If you login from xdm, uncomment this to make error messages appear
44 # in the console window.
46 # tail -f $HOME/.xsession-errors > /dev/console &
56 # Copy files considering special cases
61 file=`basename $source`
63 if [ "$file" = "WindowMaker" ]; then
64 sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
65 elif [ "$file" = "WMRootMenu" ]; then
66 if [ "$LOCALE" ]; then
67 if [ -f $GLOBALDIR/plmenu.
${LOCALE%_*} ]; then
68 cp $GLOBALDIR/plmenu.
${LOCALE%_*} $GSDIR/Defaults
/WMRootMenu
70 cp $GLOBALDIR/plmenu
$GSDIR/Defaults
/WMRootMenu
73 cp $GLOBALDIR/plmenu
$GSDIR/Defaults
/WMRootMenu
76 if test "x$GNUSTEP_USER_ROOT" = "x"; then
77 sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
80 sed -e "s|\$HOME/GNUstep|$GSDIR|g" \
81 -e "s:#wmdatadir#:$GLOBALDIR:g" \
89 echo "Installing WindowMaker $VERSION for current user..."
92 if [ ! -d $GLOBALDIR ]; then
93 echo "Could not find global data files"
94 echo "Make sure you have installed Window Maker correctly"
98 if [ ! -d $GLOBALDEFDIR ]; then
99 echo "Could not find global configurations files"
100 echo "Make sure you have installed Window Maker correctly"
104 if [ ! -d "$USERDIR" ]; then
105 echo "Could not find user directory $USERDIR"
110 if test "x$GNUSTEP_USER_ROOT" = "x"; then
112 GSDIR
=$USERDIR/GNUstep
113 if [ ! -d $GSDIR ]; then
114 echo "Creating $GSDIR user directory"
118 GSDIR
=$GNUSTEP_USER_ROOT
119 if [ ! -d $GSDIR ]; then
120 echo "Directory specified in GNUSTEP_USER_ROOT environment variable does not exist"
128 if [ ! -d "$GSDIR/.AppInfo" ]; then
129 make_dir
$GSDIR/.AppInfo
132 if [ ! -d "$GSDIR/Defaults" ]; then
133 make_dir
$GSDIR/Defaults
136 echo "Copying defaults database..."
138 FILES
=`(cd $GLOBALDEFDIR;ls -d *)`
141 if [ ! -d $GLOBALDEFDIR/$i ]; then
142 if [ -f $GSDIR/Defaults
/$i -a -z "$BATCH" ]; then
143 echo "The configuration file \"$i\" already exists in your defaults database."
144 echo "Do you wish to replace it? <y/n/a> [n] $all"
145 if [ "$all" != "a" ]; then
147 if [ "$foo" = "a" -o "$foo" = "A" ]; then
151 if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; then
152 copy
$GLOBALDEFDIR/$i $GSDIR/Defaults
/$i
155 copy
$GLOBALDEFDIR/$i $GSDIR/Defaults
/$i
161 if [ ! -d "$GSDIR/Library/Icons/" ]; then
162 echo "Creating icon library directory $GSDIR/Library/Icons"
163 if [ ! -d $GSDIR/Library
]; then
164 make_dir
$GSDIR/Library
166 make_dir
$GSDIR/Library
/Icons
170 if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
171 echo "Creating WindowMaker data library directory $GSDIR/Library/WindowMaker"
172 if [ ! -d $GSDIR/Library
]; then
173 make_dir
$GSDIR/Library
175 make_dir
$GSDIR/Library
/WindowMaker
178 if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
179 echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
180 make_dir
$GSDIR/Library
/WindowMaker
/Styles
184 if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
185 echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
186 make_dir
$GSDIR/Library
/WindowMaker
/Themes
191 if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
192 echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
193 make_dir
$GSDIR/Library
/WindowMaker
/Backgrounds
195 echo "Default Backgrounds directory already exists. Skipping..."
199 if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
200 echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
201 make_dir
$GSDIR/Library
/WindowMaker
/IconSets
203 echo "Default IconSets directory already exists. Skipping..."
207 if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
208 echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
209 make_dir
$GSDIR/Library
/WindowMaker
/Pixmaps
211 echo "Default Pixmaps directory already exists. Skipping..."
215 if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
216 echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
217 make_dir
$GSDIR/Library
/WindowMaker
/Sounds
219 echo "Default Sounds directory already exists. Skipping..."
223 if [ ! -d "$GSDIR/Library/WindowMaker/SoundSets" ]; then
224 echo "Creating sound set library $GSDIR/Library/WindowMaker/SoundSets"
225 make_dir
$GSDIR/Library
/WindowMaker
/SoundSets
227 echo "Default SoundSets directory already exists. Skipping..."
231 if test -z "#LITE#" ; then
232 FILES
=`(cd $GLOBALDIR; ls menu menu.* plmenu plmenu.?? wmmacros)`
235 if [ -f "$GSDIR/Library/WindowMaker/$i" -a -z "$BATCH" ]; then
237 echo "The file \"$i\" already exists in $GSDIR/Library/WindowMaker"
238 echo "Do you wish to replace it? <y/n/a> [n] $all"
239 if [ "$all" != "a" ]; then
241 if [ "$foo" = "a" -o "$foo" = "A" ]; then
245 if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
246 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
249 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
254 cp $GLOBALDIR/README.themes
$GSDIR/Library
/WindowMaker
255 cp $GLOBALDIR/README
$GSDIR/Library
/WindowMaker
257 test -f ~
$GSDIR/Library
/WindowMaker
/autostart || \
258 cp $GLOBALDIR/autostart.sh
$GSDIR/Library
/WindowMaker
/autostart
259 chmod +rx
$GSDIR/Library
/WindowMaker
/autostart
261 test -f ~
$GSDIR/Library
/WindowMaker
/exitscript || \
262 cp $GLOBALDIR/exitscript.sh
$GSDIR/Library
/WindowMaker
/exitscript
263 chmod +rx
$GSDIR/Library
/WindowMaker
/exitscript
266 if test -n "$BATCH" ; then
267 echo "Installation Finished"
274 #######################
281 echo "Installation Finished"
283 if test -z "#LITE#" ; then
284 echo "There are menus in 2 different file formats. The plain text format and"
285 echo "the property list format. The plain text format is more flexible, but"
286 echo "the menu in the property list format can be edited graphically. The"
287 echo "menu that will be used by default is the property list one. Read"
288 echo "$GSDIR/Library/WindowMaker/README for information on how to change it."
290 echo "Your copy of Window Maker is configured especially for KDE."
291 echo "Window Maker application menus are not available."
296 for xinit
in .xinitrc .Xclients .xsession
; do
297 test ! -f "$HOME/$xinit" && continue
298 res
="`grep wmaker $HOME/$xinit`"
299 if test "x$res" != x
; then
304 if test $wmaker_found = 1; then
305 echo "Found Window Maker to already be your default window manager."
311 trap "show_end_message;exit" 2
314 echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
315 echo "it calls wmaker when you start an X session."
316 echo "Type the name of the file that must be changed (normally .xinitrc)."
317 echo "If the file already exists, it will be backed up with a .old.$DATE "
319 echo "If you want to edit it by hand, hit <Control>-C now."
322 if test "x$file" = "x"; then
323 echo "Using .xinitrc as a default value"
327 if [ -f $USERDIR/$file ]; then
328 mv $USERDIR/$file $USERDIR/$file.old.
$DATE
331 make_script
$USERDIR/$file