#!/bin/sh

prefix="/usr"
sysconfdir="/etc"
dbusdaemon="/bin/dbus-daemon"
relocate=yes

if [ "$relocate" == "yes" ]; then
  var=`gconftool-2 --get /desktop/gnome/interface/at-spi-dbus`
  if [ "$var" == "false" ]; then
    exit 0
  fi
else
  var=`gconftool-2 --get /desktop/gnome/interface/at-spi-corba`
  if [ "$var" == "true" ]; then
    exit 0
  fi
fi

address=`${dbusdaemon} --config-file=${sysconfdir}/at-spi2/accessibility.conf --print-address`
xprop -root -f AT_SPI_BUS 8s -set AT_SPI_BUS ${address}
