# $Id:$
# Startup script for tcos utils
#

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

  # launch tcos-dbus-client
  tcos-dbus-client &

  # new device manager
  tcos-devices-ng &

  # volume levels
  tcos-volume-manager &
fi



if [ -e /etc/default/tcos-standalone ]; then
  . /etc/default/tcos-standalone
  if [ "${TCOS_STANDALONE_START}" = "1" ]; then
   tcos-dbus-client --only-local &
  fi
fi
