#!/bin/sh

mv /home/root/.xinitrc /home/root/.xinitrc.mb
#mv /home/root/.xinitrc.fvwm /home/root/.xinitrc || (echo "Please install the package to the / (root) destination, not on the SD" && echo "or CF card. It will use about 1.2 MB from your _home_ partition." && mv /home/root/.xinitrc.mb /home/root/.xinitrc && exit 1)

if [ -x /mnt/card/home/root/.xinitrc.fvwm ] ; then
  ln -s /mnt/card/home/root/.xinitrc.fvwm /home/root/.xinitrc
elif [ -x /mnt/cf/home/root/.xinitrc.fvwm ] ; then
  ln -s /mnt/cf/home/root/.xinitrc.fvwm /home/root/.xinitrc
elif [ -x /home/root/.xinitrc.fvwm ] ; then
  mv /home/root/.xinitrc.fvwm /home/root/.xinitrc
else
  mv /home/root/.xinitrc.mb /home/root/.xinitrc
  exit 1
fi
echo ""
echo "Quit from X and execute startx to begin using Fvwm."
echo "If you remove this package, it restores your original window manager."
echo "Replacing the window manager with Fvwm..."

