#!/bin/bash -e

# echo "running ring"
# /usr/local/bin/ring_old
if which beep 2>/dev/null;
then
    beep
fi

sound_dir=${activity_dir:-/usr/share}/sounds

case $LOGNAME in
    mmc)
	FILE=complete.wav
	;;
    beta)
	FILE=connect.wav
	;;
    laura)
	FILE=scream02.wav
	;;
    alice)
	FILE=explod02.wav
	;;

    root)
	FILE=ding.wav
	;;
    *)
        FILE=ding.wav
	;;
esac



# /usr/share/sounds/purple/alert.wav

if [ $# -gt 0 ];
then
    FILE=$sound_dir/$1
# Change
else
    if [ -z "$LOGNAME" ]
    then
    FILE=$sound_dir/mmc
    else
    FILE=$sound_dir/$LOGNAME
    fi
fi

echo $FILE
play_one $FILE

if [ $# -gt 1 ];
    then
#    shift
    echo $* >> /var/log/rings;
    else
    echo "$LOGNAME:$TERM:$terminal"  >> /var/log/rings;
fi

