# Set up prompts for bash: -*- mode: sh -*-
SOUNDDIR=${EMACSPEAK_DIR}/sounds/pan-chimes
EBASH=${EMACSPEAK_DIR}/bash-utils
SUCCESS=$SOUNDDIR/item.wav
FAIL=$SOUNDDIR/warn-user.wav

function prompt () {
  case "$?" in
    0) aplay -N -q   ${SUCCESS}  1>&- 2>&-;;
    *) aplay  -N -q  ${FAIL} 1>&- 2>&-  ;;
  esac
  if [ $TERM == "dumb" -o $TERM == "emacs" ]; then ${EBASH}/emnotify `pwd`; fi
}

export PROMPT_COMMAND=prompt
