# $Id:$
# Startup script for export_pulseaudio
#

if [ -f /usr/share/pyshared/tcosmonitor/shared.py ]; then
  DISPLAY_HOST=$(python /usr/share/pyshared/tcosmonitor/shared.py "$DISPLAY" 2>/dev/null)
else
  DISPLAY_HOST=$(python -c 'import os; import tcosmonitor.shared; print tcosmonitor.shared.parseIPAddress(os.environ["DISPLAY"])')
fi

if [ ! -z "${DISPLAY_HOST}" ]; then
  # export PulseAudio server
  export PULSE_SERVER="${DISPLAY_HOST}"
  ## don't export ESPEAKER VAR, eats a lot of bandwich if detected
  # export again, wine don't like alsa and OSS is not stable
  export ESPEAKER="${DISPLAY_HOST}"

  # FIXME load spanish kbmap
  #if [ -x /usr/bin/xmodmap ] && [ -e /usr/share/xmodmap/xmodmap.es ] ; then
  # xmodmap /usr/share/xmodmap/xmodmap.es
  #fi

fi

