I recently updated my desktop Kubuntu to 8.10 which among other things doesn’t have KDE 3.5 anymore but only KDE 4.1. I really liked KDE 3 which all things considered is the best window manager I’ve ever used (three years ago I wouldn’t believe I’d say it but here I am) and, therefore, transition to KDE 4 is pretty much painful for me. One of the problems I encountered was the lack of bluetooth support in KDE 4 which IMHO is something inconceivable for a major distribution like Ubuntu.
Anyways, the only thing I use bluetooth for is to download and remove photographs from cell phone (Sony Ericsson 500i). My first attempt was to install bluez-gnome and use bluetooth-applet as it is suggested in this bug report. Unfortunately, for some reason bluetooth-applet didn’t work. I could see cell phone but “Browse files on device” menu item was disabled no matter what I did. Being desperate after several attempts, I even tried to setup bluetooth in Vista (which was shipped with my laptop). To my surprise it was not easy either because Vista wanted some drivers which it couldn’t find on Internet. And all this after KDE 3 where it took me literally 1 minute to setup bluetooth so that to edit cell phone filesystem.
Of course, no bluetooth in KDE 4 doesn’t mean you cannot use it at all. So after some googling I found out that there is obextftp command line tool which can be used as shown here or here. After a little while I ended up with small script which finds directory with photos and downloads photos to the current directory:
#!/usr/bin/ruby PHONE_MAC = "00:1E:DC:1E:82:AA" # can be found with `hcitool scan` CHDIR_TO_CAMERA_ALBUM = "obexftp --bluetooth #{PHONE_MAC} --chdir 'Phone memory' --chdir 'Camera album'" output = `#{CHDIR_TO_CAMERA_ALBUM} --list` photos_folder = output.match(/folder name="(.+?)"/)[1] output = `#{CHDIR_TO_CAMERA_ALBUM} --chdir '#{photos_folder}' --list` photos = output.scan(/file name="(.+?)"/).flatten photos.each do |photo| `#{CHDIR_TO_CAMERA_ALBUM} --chdir '#{photos_folder}' --get #{photo} --delete #{photo}` end
It was the best thing KDE 4 forced me to do so far. No more clicking around with mouse, console is your best friend :)


0 comments:
Post a Comment