パッケージを検索していたら、bluemanなどを使わない、軽量のツールがありました。
saveファイルを圧縮しないのでpuppyにぴったりなのですが、CUIツールなのでずぼらな扱いが出来るようにとgtkdialogでの補完を考えてみました。
マウスの接続実験しか現状出来ていませんが参考にアップしておきます。
1.必要なパッケージ
コード: 全て選択
bluez-tools_0.1.38+git662e-2ubuntu1_i386.deb
libcap-ng0_0.6.6-1ubuntu1_i386.deb
bluez_4.98-2ubuntu7_i386.deb
libbluetooth3_4.98-2ubuntu7_i386.deb
bluez-alsa_4.98-2ubuntu7_i386.deb
bluez-cups_4.98-2ubuntu7_i386.deb
obexd-client_0.44-0ubuntu1_i386.deb
obexd-server_0.44-0ubuntu1_i386.deb
python-dbus-dev_1.0.0-1ubuntu1_all.deb
python-dbus_1.0.0-1ubuntu1_i386.deb
python〜は付属されているサンプルを実行しない限り必要ないようです。python本体はdevx.sfsに含まれているのでこれを利用するのが便利です。パッケージのインストールの最、ドキュメントやロケールをダイエットすることが出来ますがサンプルや説明書が削除されてしまうのでダイエットは避けた方がよいと思います。
説明書の内容は具体的な使い方が示されていないので、実例として次のサイトの情報が判り易いと思います。
http://wiki.openelec.tv/index.php/Bluez-tools_how-to
2.簡単なGUIの例
道中場ですが、参考に上げておきます。
/root/my-applications/bin/bt-tool-gtkdialog.sh
コード: 全て選択
#! /bin/bash
# Bluetooth-tools を利用したgtkdialogスクリプト
export MAIN_DIALOG='
<window title="BT tools">
<vbox>
<notebook labels="デバイス|ペアリング|アダプター|転送">
<vbox>
<table>
<variable>TABLE1</variable>
<width>700</width><height>200</height>
<input>cat /tmp/bt-device-info.txt</input>
</table>
<hbox>
<button><label>デバイス一覧</label>
<action> bt-device -l >/tmp/bt-device-info.txt </action>
<action type="Clear">TABLE1</action>
<action type="refresh">TABLE1</action>
</button>
<button><label>選択デバイス詳細</label>
<action> echo $TABLE1 | cut -d"(" -f2 | cut -d")" -f1 >/tmp/bt-addr.txt </action>
<action> bt-device -i `cat /tmp/bt-addr.txt` >/tmp/bt-device-info.txt </action>
<action type="Clear">TABLE1</action>
<action type="refresh">TABLE1</action>
</button>
<button><label>選択デバイスの削除</label>
<action> echo $TABLE1 | cut -d"(" -f2 | cut -d")" -f1 >/tmp/bt-addr.txt </action>
<action> bt-device -r `cat /tmp/bt-addr.txt` >/tmp/bt-device-info.txt </action>
<action type="Clear">TABLE1</action>
<action type="refresh">TABLE1</action>
</button>
</hbox>
</vbox>
<vbox>
<table>
<variable>TABLE2</variable>
<width>700</width><height>200</height>
<input> cat /tmp/bt-pair.txt </input>
</table>
<text>
<input> cat /tmp/bt-addr.txt </input>
<variable>ADDR</variable>
</text>
<hbox>
<button><label>検出</label>
<action> rxvt -e bt-s-discover.sh </action>
<action type="Clear">TABLE2</action>
<action type="refresh">TABLE2</action>
</button>
<button><label>デバイス選択</label>
<action>echo $TABLE2 | sed -e "s/Address://" >/tmp/bt-addr.txt</action>
<action type="refresh">ADDR</action>
</button>
<button><label>接続(input dev)</label>
<action> rxvt -e bt-s-input.sh </action>
<action type="Clear">TABLE2</action>
<action type="refresh">TABLE2</action>
</button>
</hbox>
</vbox>
<vbox>
<edit>
<variable>EDITOR3</variable>
<width>700</width><height>200</height>
<input file>/tmp/bt-adapter-info.txt</input>
</edit>
<hbox>
<button><label>検出可</label>
<action> bt-adapter --set Discoverable 1 >/dev/null </action>
<action> bt-adapter -i >/tmp/bt-adapter-info.txt </action>
<action type="refresh">EDITOR3</action>
</button>
<button><label>検出不可</label>
<action> bt-adapter --set Discoverable 0 >/dev/null </action>
<action> bt-adapter -i >/tmp/bt-adapter-info.txt </action>
<action type="refresh">EDITOR3</action>
</button>
<button><label>リフレッシュ</label>
<action> bt-adapter -i >/tmp/bt-adapter-info.txt </action>
<action type="refresh">EDITOR3</action>
</button>
</hbox>
</vbox>
<tree>
<input file>tmp.text</input>
<label>First</label>
<item stock="gtk-floppy">This is a floppy</item>
<item stock="gtk-cdrom">This is a CD-ROM</item>
<item>This line has no icon</item>
<variable>EDITOR</variable>
</tree>
</notebook>
<hbox>
<button cancel></button>
<button ok></button>
</hbox>
</vbox>
</window>
'
# bluetoothd の存在を確認する。存在しなければアボート
if ! [ -x /usr/sbin/bluetoothd ] ; then
echo "not find bluetoothd"
exit
fi
# bluetoothd が動作中か確認
if ! ps axc | grep -w bluetoothd >/dev/null ;then
echo "bluetoothd not runing"
exit
fi
bt-device -l >/tmp/bt-device-info.txt
echo "検出ボタンを押してください" >/tmp/bt-pair.txt
echo "non" >/tmp/bt-addr.txt
bt-adapter -i >/tmp/bt-adapter-info.txt
gtkdialog3 --program=MAIN_DIALOG
コード: 全て選択
#!/bin/sh
bt-adapter -d | tee /tmp/bt-pair.txt
コード: 全て選択
#!/bin/sh
ADDR=`cat /tmp/bt-addr.txt`
bt-device -c $ADDR
bt-input -c $ADDR
bt-device --set $ADDR Trusted 1