#!/bin/sh
# Copyright  1997, Guylhem Aznar (guylhem@danmark.linux.eu.org)
# Freely distribuable under the terms of the GPL license .

AFDIR=$HOME/.step

# Update desktop-backgrounds-pictures

 $AFDIR/make-picturesmenu

# Update steprc

 if [ ! -d $AFDIR ] ; then
  echo "No directory $AFDIR, exiting !"
  exit
 fi
 if [ ! -f $AFDIR/afterstep.base ] ; then
  echo "No configuration file $AFDIR/afterstep.base, exiting !"
  exit
 fi
 if [ ! -f $AFDIR/afterstep.look ] ; then
  echo "No configuration file $AFDIR/afterstep.look, exiting !"
  exit
 fi
 if [ ! -f $AFDIR/afterstep.config ] ; then
  echo "No configuration file $AFDIR/afterstep.config, exiting !"
  exit
 fi
 if [ ! -f $AFDIR/afterstep.modules ] ; then
  echo "No configuration file $AFDIR/afterstep.modules, exiting !"
  exit
 fi
 if [ ! -f $AFDIR/afterstep.menus ] ; then
  echo "No configuration file $AFDIR/afterstep.menus, exiting !"
  exit
 fi
 if [ ! -d $AFDIR/start ] ; then
  echo "No directory $AFDIR/start, exiting !"
  exit
 fi
 if [ ! -f $AFDIR/afterstep.bindings ] ; then
  echo "No configuration file $AFDIR/afterstep.bindings, exiting !"
  exit
 fi

 # Add startmenu options

 $AFDIR/make-startmenu

 # Merge config files

 echo "Do not modify ! It's rebuilt at every startup !\n" > $AFDIR/steprc
 cat $AFDIR/afterstep.base >> $AFDIR/steprc
 cat $AFDIR/afterstep.look >> $AFDIR/steprc
 cat $AFDIR/afterstep.config >> $AFDIR/steprc 
 cat $AFDIR/afterstep.modules >> $AFDIR/steprc
 cat $AFDIR/afterstep.menus >> $AFDIR/steprc
 cat ~/.step/tmp/startmenu-made >> $AFDIR/steprc
 cat $AFDIR/afterstep.bindings >> $AFDIR/steprc

