Bitcoin donations are welcome:14snQXeLcnJtWUduKZ6rC2MHdPYrYar1Tw

Thursday, July 1, 2010

Bluetooth and Thunar

This is a copy paste from a forum. Storing it here in case it should disappear, and this is the "golden ticket" to bluetooth browing in fluxbox :) Remember to change dolphin to browser of choice. For example thunar.

SOURCE: http://blueman-project.org/forum/viewtopic.php?f=7&t=80&sid=48f91d78e39e09341f63507c1036d22f&start=10

Hi,

first, thanks a lot for the useful pointer on how to use something different than nautilus for blueman's "Browse Device".

It works well, but nevertheless, there are a few shortcomings:
  • BT channel 10 is only correct for some devices (mainly Nokia S40, it seems).
  • There is no explicit removal of the obex mount and its mount point.
  • Only one device can be browsed at once.
The following script gets rid of these issues. I have tested it successfully with more than one devices (2, actually) on Debian Squeeze with KDE4 and dolphin. Every other file manager will work just as well, you only need to change the dolphin invocation appropriately.

Usage
The first click on "Browse Device" will setup the obexfs mount point (as .obex- in your home directory) and open dolphin with it. The second click on "Browse Device" will disable the obex mount and also remove the mount point again. Blueman's connection graph will help to indicate the state you are currently in.

Requirements
You will (at least) need the packages blueman, obexfs, fuse-utils from your favorite distribution. You may need a new session start to make sure you are a member of the fuse group. Additionally, the script (as it is) expects a writable logfile, which you may create as root with:
Code: Select all
touch /var/log/blueman-browse-helper.log chmod a+rw /var/log/blueman-browse-helper.log
Now, enter
Code: Select all
blueman-browse-helper %d
in the field Command to start an obex ftp browser in the Advanced section of Local Services... (after right-click on tray icon) and save the following script accordingly as (e.g.) /usr/local/bin/blueman-browse-helper (as root, of course, and make it executable for users).

Now, finally, here comes the script:

Code:
#!/bin/bash log=/var/log/blueman-browse-helper.log mp=~/.obex-"$1" channel=`sdptool search --bdaddr "$1" FTP | awk '/Channel:/ {print $2}'` if [ -e "$mp" ]; then         echo "`date`: cleaning up mount point '$mp'"                             >> $log         fusermount -u -z "$mp"                                                  &>> $log         rmdir "$mp"                                                             &>> $log else         echo "`date`: opening FTP channel '$channel' for mount point '$mp'"      >> $log         mkdir "$mp"                                                             &>> $log         obexfs -b "$1" -B $channel "$mp"                                        &>> $log         dolphin "$mp"                                                           &>> $log fi echo "`date`: `basename $0` finished for mount point '$mp'"                      >> $log


Have fun,
musial

1 comment:

  1. My blueman 'transfer' settings page is empty and I cannot enter the new browser command as per your instructions. Any idea why this page would not be working? (Squeeze)

    ReplyDelete