#!/bin/bash

state=`gconftool --get /system/gstreamer/0.10/default/musicaudiosink | cut -d\  -f1`

if [ $state == "autoaudiosink" ]; then
  gconftool --type string --set /system/gstreamer/0.10/default/musicaudiosink "alsasink device=bluetooth"
  zenity --info --title="GStreamer" --text="Switched to Bluetooth headphones."
else
  gconftool --type string --set /system/gstreamer/0.10/default/musicaudiosink "autoaudiosink"
  zenity --info --title="GStreamer" --text="Switched to speaker output."
fi

echo musicaudiosink set to `gconftool --get /system/gstreamer/0.10/default/musicaudiosink` 
