#!/bin/sh
#
# Little script to set the audio driver of horgand
#
# Copyright (C) 2005 Free Ekanayaka <free@agnula.org>
#
# This script is licensed under the GNU GPL v2 - you can find a
# complete copy of the license under /usr/share/common-licenses/GPL-2

DRIVER="Alsa"
BINARY="/usr/lib/horgand/horgand"

if [ $(ps -C jackd| wc -l) -gt 1 ]; then
	DRIVER="Jack"
fi

cat <<EOF > ~/.Horgand
Not Connected
$DRIVER
/usr/share/horgand/Default.horeb
EOF

exec $BINARY $@
