#!/bin/bash
# Install script for TtM. (C) 2000, 2001 Ian Hutchinson.

if [ ! -d $HOME/bin ]
then
    echo Making directory $HOME/bin
	mkdir $HOME/bin
fi
if [ ! `echo $PATH | fgrep -c $HOME/bin` = 1 ]
then
#PATH=$HOME/bin:$PATH
echo " I've added $HOME/bin to your PATH, but that needs to be made permanent."
echo " Edit your shell resources file, typically .bash_profile."
echo " The directory $HOME/bin is where the TtM programs are kept."
fi
echo " Copying ttm, ps2gif, and latex2gif to $HOME/bin."
cp ttm $HOME/bin/;
cp ps2gif $HOME/bin/;
cp ps2png $HOME/bin/;
cp latex2gif $HOME/bin/;

if [ -d $HOME/.kde/share/applnk ]
then
	if cp ttm.kdelnk $HOME/.kde/share/applnk/;
	then 
        cp ttm_mini.gif $HOME/.kde/share/icons/mini/
        cp ttm_icon.gif $HOME/.kde/share/icons/
	if ln -s $HOME/.kde/share/applnk/ttm.kdelnk $HOME/Desktop/ttm.kdelnk;
	then
	echo " Installed kdelnks. Restarting kfm will show ttm on desktop.";
	else
	echo " Failed to install kdelnk on Desktop."
	fi
	else
	echo " Failed to install kdelnk in $HOME/.kde/share/applnk/"
	fi
else
	echo " You don't seem to have KDE installed.";
fi
