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%_*}
72 source=$GLOBALDIR/plmenu
75 source=$GLOBALDIR/plmenu
77 sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
78 $source > $GSDIR/Defaults
/WMRootMenu
80 if test "x$GNUSTEP_USER_ROOT" = "x"; then
81 sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
84 sed -e "s|\$HOME/GNUstep|$GSDIR|g" \
85 -e "s:#wmdatadir#:$GLOBALDIR:g" \
93 echo "Installing WindowMaker $VERSION for current user..."
96 if [ ! -d $GLOBALDIR ]; then
97 echo "Could not find global data files"
98 echo "Make sure you have installed Window Maker correctly"
102 if [ ! -d $GLOBALDEFDIR ]; then
103 echo "Could not find global configurations files"
104 echo "Make sure you have installed Window Maker correctly"
108 if [ ! -d "$USERDIR" ]; then
109 echo "Could not find user directory $USERDIR"
114 if test "x$GNUSTEP_USER_ROOT" = "x"; then
116 GSDIR
=$USERDIR/GNUstep
117 if [ ! -d $GSDIR ]; then
118 echo "Creating $GSDIR user directory"
122 GSDIR
=$GNUSTEP_USER_ROOT
123 if [ ! -d $GSDIR ]; then
124 echo "Directory specified in GNUSTEP_USER_ROOT environment variable does not exist"
132 if [ ! -d "$GSDIR/.AppInfo" ]; then
133 make_dir
$GSDIR/.AppInfo
136 if [ ! -d "$GSDIR/Defaults" ]; then
137 make_dir
$GSDIR/Defaults
140 echo "Copying defaults database..."
142 FILES
=`(cd $GLOBALDEFDIR;ls -d *)`
145 if [ ! -d $GLOBALDEFDIR/$i ]; then
146 if [ -f $GSDIR/Defaults
/$i -a -z "$BATCH" ]; then
147 echo "The configuration file \"$i\" already exists in your defaults database."
148 echo "Do you wish to replace it? <y/n/a> [n] $all"
149 if [ "$all" != "a" ]; then
151 if [ "$foo" = "a" -o "$foo" = "A" ]; then
155 if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; then
156 copy
$GLOBALDEFDIR/$i $GSDIR/Defaults
/$i
159 copy
$GLOBALDEFDIR/$i $GSDIR/Defaults
/$i
165 if [ ! -d "$GSDIR/Library/Icons/" ]; then
166 echo "Creating icon library directory $GSDIR/Library/Icons"
167 if [ ! -d $GSDIR/Library
]; then
168 make_dir
$GSDIR/Library
170 make_dir
$GSDIR/Library
/Icons
174 if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
175 echo "Creating WindowMaker data library directory $GSDIR/Library/WindowMaker"
176 if [ ! -d $GSDIR/Library
]; then
177 make_dir
$GSDIR/Library
179 make_dir
$GSDIR/Library
/WindowMaker
182 if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
183 echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
184 make_dir
$GSDIR/Library
/WindowMaker
/Styles
188 if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
189 echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
190 make_dir
$GSDIR/Library
/WindowMaker
/Themes
195 if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
196 echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
197 make_dir
$GSDIR/Library
/WindowMaker
/Backgrounds
199 echo "Default Backgrounds directory already exists. Skipping..."
203 if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
204 echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
205 make_dir
$GSDIR/Library
/WindowMaker
/IconSets
207 echo "Default IconSets directory already exists. Skipping..."
211 if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
212 echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
213 make_dir
$GSDIR/Library
/WindowMaker
/Pixmaps
215 echo "Default Pixmaps directory already exists. Skipping..."
219 if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
220 echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
221 make_dir
$GSDIR/Library
/WindowMaker
/Sounds
223 echo "Default Sounds directory already exists. Skipping..."
227 if [ ! -d "$GSDIR/Library/WindowMaker/SoundSets" ]; then
228 echo "Creating sound set library $GSDIR/Library/WindowMaker/SoundSets"
229 make_dir
$GSDIR/Library
/WindowMaker
/SoundSets
231 echo "Default SoundSets directory already exists. Skipping..."
235 if test -z "#LITE#" ; then
236 FILES
=`(cd $GLOBALDIR; ls menu menu.* plmenu plmenu.?? wmmacros)`
239 if [ -f "$GSDIR/Library/WindowMaker/$i" -a -z "$BATCH" ]; then
241 echo "The file \"$i\" already exists in $GSDIR/Library/WindowMaker"
242 echo "Do you wish to replace it? <y/n/a> [n] $all"
243 if [ "$all" != "a" ]; then
245 if [ "$foo" = "a" -o "$foo" = "A" ]; then
249 if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
250 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
253 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
258 cp $GLOBALDIR/README.themes
$GSDIR/Library
/WindowMaker
259 cp $GLOBALDIR/README
$GSDIR/Library
/WindowMaker
261 test -f ~
$GSDIR/Library
/WindowMaker
/autostart || \
262 cp $GLOBALDIR/autostart.sh
$GSDIR/Library
/WindowMaker
/autostart
263 chmod +rx
$GSDIR/Library
/WindowMaker
/autostart
265 test -f ~
$GSDIR/Library
/WindowMaker
/exitscript || \
266 cp $GLOBALDIR/exitscript.sh
$GSDIR/Library
/WindowMaker
/exitscript
267 chmod +rx
$GSDIR/Library
/WindowMaker
/exitscript
272 if test -n "$BATCH" ; then
273 echo "Installation Finished"
280 #######################
287 echo "Installation Finished"
289 if test -z "#LITE#" ; then
290 echo "There are menus in 2 different file formats. The plain text format and"
291 echo "the property list format. The plain text format is more flexible, but"
292 echo "the menu in the property list format can be edited graphically. The"
293 echo "menu that will be used by default is the property list one. Read"
294 echo " $GSDIR/Library/WindowMaker/README"
295 echo "for information on how to change it."
296 if [ "${inst_menu%.*}" == "menu" ]; then
297 echo "However, since you have locale set to $LOCALE and plmenu for such locale"
298 echo "was not found, your WMRootMenu contains path to text formated menu:"
299 echo " $GSDIR/Library/WindowMaker/$inst_menu"
302 echo "Your copy of Window Maker is configured especially for KDE."
303 echo "Window Maker application menus are not available."
308 for xinit
in .xinitrc .Xclients .xsession
; do
309 test ! -f "$HOME/$xinit" && continue
310 res
="`grep wmaker $HOME/$xinit`"
311 if test "x$res" != x
; then
316 if test $wmaker_found = 1; then
317 echo "Found Window Maker to already be your default window manager."
323 trap "show_end_message;exit" 2
326 echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
327 echo "it calls wmaker when you start an X session."
328 echo "Type the name of the file that must be changed (normally .xinitrc)."
329 echo "If the file already exists, it will be backed up with a .old.$DATE "
331 echo "If you want to edit it by hand, hit <Control>-C now."
334 if test "x$file" = "x"; then
335 echo "Using .xinitrc as a default value"
339 if [ -f $USERDIR/$file ]; then
340 mv $USERDIR/$file $USERDIR/$file.old.
$DATE
343 make_script
$USERDIR/$file