I found a useful python script on Gentoo's boards for using the bluez-utils 
d-bus interface for activating bluetooth keyboards so that they will connect 
automatically when you turn them on.  I've also modified it and created one 
that does the same thing for A2DP headsets, and I've decided to share :)  The 
keyboard one can/must be used in lieu of hidd, so it's for newer versions of 
bluez-utils (Available in the testing and unstable feeds)

You also have to bond (pair) the devices first.  Instructions for that are 
here: http://wiki.bluez.org/wiki/HOWTO/Bonding  (Feel free to make a 
convenience script for the bonding process too)

You may also have to run:
dbus-send --system --type=method_call --print-reply --dest=org.bluez 
/org/bluez/hci0 org.bluez.Adapter.SetTrusted? string:AA:BB:CC:DD:EE:FF  (Feel 
free to add this to the script)

If you want to use an A2DP headset you can add an entry like this to your 
/etc/asound.conf
----
pcm.bluetooth {
        type bluetooth
        device "AA:BB:CC:DD:EE:FF"
        profile "auto"
}
----

And then you can tell alsa aware applications to use it for output.  i.e.:

mplayer -ao alsa:device=bluetooth nifty.mp3

(I believe you can also name it pcm.!default and it will become the default.)

-- 
Daniel Benoy
http://daniel.benoy.name

Attachment: audtool.py
Description: application/python

Attachment: hidtool.py
Description: application/python

_______________________________________________
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community

Reply via email to