#!/bin/sh

PREREQ=""
DESCRIPTION="Preparing for maybe-ubiquity mode..."

prereqs()
{
       echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
       prereqs
       exit 0
       ;;
esac

. /scripts/casper-functions

log_begin_msg "$DESCRIPTION"

#should cover both maybe-ubiquity and only-ubiquity and automatic-ubiquity modes
if grep "ubiquity" /proc/cmdline >/dev/null; then
    mkdir -p /root/home/$USERNAME/.config
    cp -R /root/etc/xdg/xdg-mythbuntu/xfce4  /root/home/$USERNAME/.config
    chroot /root chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
cat > /root/usr/share/images/desktop-base/joy.xml << EOF
<background>
  <static>
    <duration>8640000.0</duration>
    <file>
      <size width="2560" height="1600">/usr/share/images/mythbuntu/bg_2560x1600_original.jpg</size>
    </file>
  </static>
</background>

EOF
fi

log_end_msg
