#!/bin/sh
#
# VSA helper shell script to install themes etc.
#
# 17Dec1999 Charles <int@linuxcore.com>
#
# $Id: vsa-install,v 1.2 1999/12/20 04:37:44 int Exp $

cmd=$1

if [ $# = 0 ]
then
    echo "Usage: vsa_install <what> [args]"
    exit 1
fi


vsa_path=$HOME/.vsa
system_theme_path=/usr/share/vsa/themes
user_theme_path=$vsa_path/themes


function make_theme_dir()
{
    mkdir $vsa_path 2> /dev/null
    mkdir $user_theme_path 2> /dev/null
}

function install_system_themes()
{
    if [ ! -d $system_theme_path ]; 
    then 
	echo "System theme dir doesn't exist!"
	exit 1; 
    fi

    make_theme_dir

    for path in $system_theme_path/*
    do
	dir=`basename $path`
	upath=$user_theme_path/$dir
	if [ -d "$upath" ]; then continue; fi

	echo "Installing theme: $dir"
	cp -ar $path $user_theme_path/
    done
}


case $cmd in
    system_themes)
	install_system_themes
	;;
esac
