#!/bin/sh

# Localisation
export TEXTDOMAINDIR="/usr/share/locale"
export TEXTDOMAIN=kanotix-vdr

DIALOG=dialog

INSTALLED=""
[ -d /KNOPPIX -o -d /KANOTIX ] || INSTALLED="yes"

if [ -z "$INSTALLED" ]; then
   if grep -q unionfs /proc/mounts; then
      echo Unionfs found.
   else
      echo Activating Unionfs now.
      mkdir -p /tmp/union
      UNION=/KNOPPIX
      [ -d /KANOTIX ] && UNION=/KANOTIX
      mount -t unionfs -o dirs=/tmp/union/:$UNION /none $UNION/ 2>&1 >/dev/null
   fi
fi

$DIALOG --title $"Xine Autostart" --yesno $"Shall Xine-Player (TV Picture) be started as default with KDE?" 0 0
	answer_autostart="$?"
	tput clear

if [ "$answer_autostart" = 0 ] ; then
	cp /usr/sbin/vdr-xine $HOME/.kde/Autostart
        echo
        echo $"Xine Autostart active!"
else
        rm -f $HOME/.kde/Autostart/vdr-xine
        echo
        echo $"Xine Autostart not active!"
fi

echo
echo $"Press any key" && read