#!/bin/bash
BASHISHDIR="/usr/share/bashish"
BASHISH_SHELL="/bin/bash"
##################################################################################
## Bashish, a console theme engine
## Copyright (C) 2005 Thomas Eriksson
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
##################################################################################
##
## this is the interface to the user when the 'changetheme' command is
## issued, if no arguments are given, it will print out the name of the theme
##
## the 'changetheme' command changes themes, to change prompt it must be
## complemented by native shell script sourcing the command prompt file
##
###############################################################################


## disable application themeing
export BASHISH_DISABLED=1

## restart with XTerm if not connected to a tty
tty -s||{
	test "$1"||exec xterm $0
}

## generic C-isch argv 
## portable among posix shells
test "x$1" != x && {
n=0
BASHISH_ARGV[$n]="$1"
while test "x$2" != x
do
	shift
	let n++
	BASHISH_ARGV[$n]=$1
done
}
BASHISH_ARGC=${#BASHISH_ARGV[*]}
## load initialization file
. $BASHISHDIR/main/bashishtheme/init||{ printf "\n\n$0: load error, reinstall bashish\n";exit 2;}
