3 # Install Window Maker for the current user
6 # directory where system wide configuration is stored
7 GLOBALDIR
="#pkgdatadir#"
20 cat << EOF >> $ISCRIPT
22 # Window Maker default X session startup script
26 # If you login from xdm, uncomment this to make error messages appear
27 # in the console window.
29 # tail -f $HOME/.xsession-errors > /dev/console
39 # Copy files considering special cases
44 file=`basename $source`
46 if [ "$file" = "WMRootMenu" ]; then
47 echo \"$GSDIR/Library
/WindowMaker
/menu
\" > \
49 elif [ "$file" = "WindowMaker" ]; then
50 sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
52 if test "x$GNUSTEP_USER_ROOT" = "x"; then
55 sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
62 echo "Installing WindowMaker $VERSION for current user..."
65 if [ ! -d $GLOBALDIR ]; then
66 echo "Could not find global configurations files"
67 echo "Make sure you've installed Window Maker correctly"
71 if [ ! -d "$USERDIR" ]; then
72 echo "Could not find user directory $USERDIR"
77 if test "x$GNUSTEP_USER_ROOT" = "x"; then
79 GSDIR
=$USERDIR/GNUstep
80 if [ ! -d $GSDIR ]; then
81 echo "Creating $GSDIR user directory"
85 GSDIR
=$GNUSTEP_USER_ROOT
86 if [ ! -d $GSDIR ]; then
87 echo "Directory specified in GNUSTEP_USER_ROOT environment variable does not exist"
95 if [ ! -d "$GSDIR/.AppInfo" ]; then
99 if [ ! -d "$GSDIR/Defaults" ]; then
100 mkdir
$GSDIR/Defaults
103 echo "Copying defaults database..."
105 FILES
=`(cd $GLOBALDIR/Defaults;ls *)`
108 if [ -f $GSDIR/Defaults
/$i ]; then
109 echo "The configuration file \"$i\" already exists in your defaults database."
110 echo "Do you wish to replace it? <y/n/a> [n] $all"
111 if [ "$all" != "a" ]; then
113 if [ "$foo" = "a" -o "$foo" = "A" ]; then
117 if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; then
118 copy
$GLOBALDIR/Defaults
/$i $GSDIR/Defaults
/$i
121 copy
$GLOBALDIR/Defaults
/$i $GSDIR/Defaults
/$i
126 if [ ! -d "$GSDIR/Library/Icons/" ]; then
127 echo "Creating icon library directory $GSDIR/Library/Icons"
128 if [ ! -d $GSDIR/Library
]; then
131 mkdir
$GSDIR/Library
/Icons
135 if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
136 echo "Creating WindowMaker data library directory $GSDIR/Library/WindowMaker"
137 if [ ! -d $GSDIR/Library
]; then
140 mkdir
$GSDIR/Library
/WindowMaker
143 if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
144 echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
145 mkdir
$GSDIR/Library
/WindowMaker
/Styles
147 echo "Styles directory already exists. Skipping..."
151 if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
152 echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
153 mkdir
$GSDIR/Library
/WindowMaker
/Themes
155 echo "Themes directory already exists. Skipping..."
159 if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
160 echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
161 mkdir
$GSDIR/Library
/WindowMaker
/Backgrounds
163 echo "Default Backgrounds directory already exists. Skipping..."
167 if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
168 echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
169 mkdir
$GSDIR/Library
/WindowMaker
/IconSets
171 echo "Default IconSets directory already exists. Skipping..."
175 if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
176 echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
177 mkdir
$GSDIR/Library
/WindowMaker
/Pixmaps
179 echo "Default Pixmaps directory already exists. Skipping..."
183 if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
184 echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
185 mkdir
$GSDIR/Library
/WindowMaker
/Sounds
187 echo "Default Sounds directory already exists. Skipping..."
191 if [ ! -d "$GSDIR/Library/WindowMaker/SoundSets" ]; then
192 echo "Creating sound set library $GSDIR/Library/WindowMaker/SoundSets"
193 mkdir
$GSDIR/Library
/WindowMaker
/SoundSets
195 echo "Default SoundSets directory already exists. Skipping..."
199 echo "Copying default menu configuration files..."
200 FILES
=`(cd $GLOBALDIR;ls -1 menu* plmenu wmmacros)`
203 if [ -f "$GSDIR/Library/WindowMaker/$i" ]; then
204 echo "The file \"$i\" already exists in $GSDIR/Library/WindowMaker"
205 echo "Do you wish to replace it? <y/n/a> [n] $all"
206 if [ "$all" != "a" ]; then
208 if [ "$foo" = "a" -o "$foo" = "A" ]; then
212 if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
213 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
216 copy
$GLOBALDIR/$i $GSDIR/Library
/WindowMaker
/$i
221 cp $GLOBALDIR/README
$GSDIR/Library
/WindowMaker
222 cp -i $GLOBALDIR/autostart.sh
$GSDIR/Library
/WindowMaker
/autostart
223 chmod +rx
$GSDIR/Library
/WindowMaker
/autostart
226 #######################
228 DATE
=`date +%m%d%H%M`
233 echo "Installation Finished"
235 echo "There are menus in 2 different file formats. The plain text format and"
236 echo "the property list format. The plain text format is more flexible, but"
237 echo "the menu in the property list format can be edited graphically. The"
238 echo "menu that will be used by default is the plain text. Read"
239 echo "$GSDIR/Library/WindowMaker/README for information on how to change it."
244 trap "show_end_message;exit" 2
247 echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
248 echo "it calls wmaker when you start an X session."
249 echo "Type the name of the file that must be changed (normally .xinitrc)."
250 echo "If the file already exists, it will be backed up with a .old.$DATE extension"
251 echo "If you want to edit it by hand, hit <Control>-C now."
254 if test "x$file" = "x"; then
255 echo "Using .xinitrc as a default value"
259 if [ -f $USERDIR/$file ]; then
260 mv $USERDIR/$file $USERDIR/$file.old.
$DATE
263 make_script
$USERDIR/$file