#!/bin/sh

PREREQ=""
DESCRIPTION="Fixing Mythbuntu icons..."

. /scripts/casper-functions

prereqs()
{
       echo "$PREREQ"
}

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

log_begin_msg "$DESCRIPTION"

#Mythbuntu specific
if [ -d "/root/usr/share/mythbuntu" ]; then
    #the purdy ubiquity welcome screen icon
    mv /root/usr/share/mythbuntu/ubiquity_computer.png /root/usr/share/ubiquity/pixmaps/ubuntu_installed.png
    #overwrite the env w/ our preferred bg
    mv /root/usr/share/mythbuntu/live_background.jpg /root/usr/share/images/mythbuntu/bg_2560x1600.jpg
    #don't want users double clicky on these.  they dont work in live mode alone!
    rm -f /root/usr/share/applications/mythtv-setup.desktop
    rm -f /root/usr/share/applications/mythtv.desktop
    #install our desktop file on the desktop
    chroot /root install -d -o $USERNAME -g $USERNAME /home/$USERNAME/Desktop
    chroot /root install -D -o $USERNAME -g $USERNAME /usr/share/applications/mythbuntu-live-frontend.desktop /home/$USERNAME/Desktop/mythbuntu-live-frontend.desktop
    #hide removable media icons
    if [ -f "/root/etc/xdg/xdg-mythbuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml" ]; then
      sed -i "s/<property\ name=\"show-removable\"\ type=\"bool\"\ value=\"true\"\/>/<property\ name=\"show-removable\"\ type=\"bool\"\ value=\"false\"\/>/" /root/etc/xdg/xdg-mythbuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
    fi
fi

log_end_msg
