As DanC mentioned, we’ve been playing with configuring Firefox in Gnome to use
tel: URIs with our Vonage service; in short, this means you can click on a link à la tel:+1.555.123.4567 and get your Vonage phone calls the said the number. In practice, your phone starts ringing, and once you pick it up, it dials the said number.
Most of the actual work is done by Click 2 Call which offers a Web interface to your Vonage line. But getting integrated nicely in your browsing/desktop experience is fun.
So, how do you get a new URI scheme to be handled by Firefox or Gnome?
Well, first, getting a new URI scheme to be handled by Firefox is equivalent as getting it handled for Gnome, since for some reason, Firefox uses the generic
gnome-open command to handled unknown URI schemes. I haven’t been able to find how or why, so I don’t know if that’s Debian specific or if this is true for any Firefox running on Linux et al.
Getting a new URI handler in Gnome is not necessarily well-documented, but once you know, it’s very easy; the set of three commands below is all that’s needed to get my local script vonage-call to be added as the handler for
gconftool-2 -t string -s /desktop/gnome/url-handlers/tel/command "bin/vonage-call %s"
gconftool-2 -s /desktop/gnome/url-handlers/tel/needs_terminal false -t bool
gconftool-2 -t bool -s /desktop/gnome/url-handlers/tel/enabled true
So, what does this
vonage-call script do? Well, most of the actual work is done by a simple curl call to the said Web interface; but I’ve added a bit of interfacing to be improve the look & feel of the operation, using
zenity, Gnome’s equivalent of xdialog.
So, when you call
vonage-call without argument, you’re asked for a phone number to call:
Once entered (or directly if you’ve followed a
tel: link), you’re asked for confirmation :
And eventually, there is even a progress bar for the few seconds it takes to run the curl command:
To finalize the integration of this small script into the desktop, and following Sun’s documentation on Gnome integration, I’ve managed to add an entry in my Applications->Internet menu… with great pain, I must confess.
The key to be able to use a personalized menu per-User on gnome is to have the following file created
<VFolderInfo> <!-- path doesn't understand $HOME or ~/ ; maybe it would understand it as a relative path to $HOME? didn't test --> <WriteDir>/home/dom/.gnome2/vfolders/applications</WriteDir> </VFolderInfo>
This basically instructs Gnome that it can write into the said directory — make sure to actually create it (mkdir -p .gnome2/vfolders/applications) — when you try to personalize the menu with Nautilus; otherwise, you get a permission denied error, since Nautilus would try to modify the content of the directory defined at a higher level in
/etc/gnome-vfs-2.0/applications-all-users.vfolder-info; once this is done (and despite the complete lack of documentation of this), you can use Nautilus to add (and probably remove) launchers in your menu. This is with Gnome 2.8; I’ve read that Gnome 2.12 fixes some of the menu-editing difficultiess, so this may be easier if you’re running a bleeding edge version.
A launcher in Gnome (and KDE) is a simple
.desktop file that lists a set of well-defined properties; here is what I’ve used for my little script
vonage.desktop that I placed in the directory created above,
[Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Vonage caller Comment=Call phone numbers using Vonage Exec=/home/dom/bin/vonage-call Icon=stock_landline-phone.png Terminal=false Type=Application Categories=Application;Internet;
This can actually be created with the graphical interface, I think: right-click on your desktop, create a new launcher bound to the right command and selecting the right icon; once done, open the “Applications” virtual folder in Nautilus (either from the virtual “Start here” folder, or using the
applications-all-users:// URI (sigh!)), and copy your new launcher in it; the right thing should happen:
Well, that’s about it; there is still a bit too much of magic for my liking, but the fact that this is doable, and even fairly easy once you know the magic is already pretty sweet!