Send files to a bluetooth device from Linux

Short and sweet, this one.  I think nautilus tries to be clever and produce a “send to bluetooth” menu option when you right-click on certain file types.  I've never had this work terribly well, if at all, so I've added the following script to my collection in ~/.gnome2/nautilus-scripts.  I called it Send via Bluetooth, but anything'll do.

Then for any file, I can right-click and select Scripts/Send via Bluetooth and the file gets whipped to my phone.

  1. #!/bin/sh
  2. # Send Selected File via Bluetooth.
  3. function do_it() {
  4. bluetooth-sendto "$@"
  5. # gnome-obex-send "$@"
  6. }
  8. quoted=$(echo -e "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | \
  9. awk 'BEGIN { FS = "\n" } { printf "\"%s\" ", $1 }' | \
  10. sed -e s#\"\"##)
  11. eval "do_it $quoted"

On my Fedora box, bluetooth-send comes from the gnome-bluetooth package.  Previsouly, the tool I had to use was gnome-obex-send , but that's been superseded.


About fnx

PSN: the_phoenix
This entry was posted in Software, Tech and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>