This is as days pass by, by Stuart Langridge

And this is Converter Deskbar, written , and concerning Deskbar

Another thing for Gnome Deskbar: a converter that converts one unit to another. Enter "23m in feet" and immediately get the answer that that distance is 75.46ft. Inspired by Google Calculator's similar behaviour, you can download the program and drop it into your ~/.gnome2/deskbar-applet/handlers folder. You'll need to have GNU Units installed as well (install the "units" package in Ubuntu). Some examples: Convert '$50000 in pounds', '4 lightseconds in furlongs', and '4 litres in teaspoons' Download Converter Deskbar now!

Comments

joeljkp

Does this only work for a specific version of Deskbar? I have 2.14.2 (Ubuntu 6.06) and it's not doing anything.

sil

joeljkp: that's the version I've got. Have you enabled the plugin in the preferences window for Deskbar?

joeljkp

Ah, forgot about that. Thanks!

Alex

Your download link above is broken, it gives a WebDAV error: "Could not open the requested SVN filesystem".

sheepeatingtaz

Am I doing something wrong? I had this working back when you first released it, but I can't get it going now on feisty (Deskbar 2.17.90). I can't see it in the list of plugins in the preferences.

Aaron Hochwimmer

I have much the same problem as the last poster (fiesty beta). The converter entry does not appear in the list of plugins in the preferences. Note I have tried a different plugin (hostname lookup I think) which works ok.

Would you mind checking this issue out?

Thanks for writing this - it saves me running 'units' in a terminal.

sil

I'll take a look when I upgrade to feisty, which will be shortly.

papo

Hi

Just alter line 14 of the script. Turn

import deskbar.Handler, deskbar

into

import deskbar.Handler, deskbar.Match

to make the script work under feisty. Don't forget to install the units package and enable the plugin in the preferencies dialog.

Stuart, thanks for that cool plugin :)

Nick

The suggestion from papo don't work for me in Feisty.

Converter is always hidden.

papo

Hi

You can run

/usr/lib/deskbar-applet/deskbar-applet -w

from a shell to gather more information about the problem. This runs th deskbar applet in standalone mode and gives a lot of information about what's going on. No need to instsall the debug package.

With the original plugin, I got this:

Error loading the file: /home/mathias/.gnome2/deskbar-applet/handlers/converter.py.

Traceback (most recent call last):

File "/usr/lib/python2.5/site-packages/deskbar/ModuleLoader.py", line 91, in import_module

mod = pydoc.importfile (filename)

File "pydoc.py", line 259, in importfile

raise ErrorDuringImport(path, sys.exc_info())

ErrorDuringImport: problem in /home/mathias/.gnome2/deskbar-applet/handlers/converter.py - : 'module' object has no attribute 'Match'

After having altered line 14 as discussed, I get this:

Loading module 'Converter' from file /home/mathias/.gnome2/deskbar-applet/handlers/converter.py.

Providing your output would be a big help to whomever is going to debug this.

Please also note that Converter is hidden as long as the regexp does not match: Here be dragons does not trigger Converter, while as 10 ly in parsecs does.

Also note that Converter has to be enabled in the prefs.

Romain

Great stuff. Thanks for that.

Any way to make it support the "€" character for euros ?

zanglang

About the plugin not showing on Feisty, it seems that Python requires a line:

# coding=utf-8

added at the top of the file as per PEP 0263: http://www.python.org/dev/peps/pep-0263/

Kudos for writing such an awesomely useful plugin, by the way. :)

Robby

Thanks zanglang--that worked perfectly!!

Endolith

In addition to the line 14 change and the utf-8 change, if you just installed units, you have to restart to get it to work.

To really emulate Google Calculator, you need to get together with this guy and make a plugin that does both, like Google Calculator. Then I can type "3+4" and get "7", type "2 inches in mm" and get "50.8 millimeters", or mix it up and type "15 V / 3 ohm" and get "5 amperes". ;-)

(And while you're at it, recognize things like uF that Google doesn't recognize.)

Endolith

And a date and time calculator would be good. Like http://www.timeanddate.com

Google calculator can't do this yet, but it's hard to do this stuff in your head.

La otra bola de cristal -

[...] Pero aún hay más y es que si esto del terminal no es lo tuyo o no te termina de convencer, también existe un plugin para el deskbar-applet, llamado converter deskbar. [...]

Linux Music » Blog Archive » Instalando el applet Converter en Ubuntu

[...] Fuente-> La Otra Bola De Cristal Fuente del Script-> Converter Deskbar Enlace Relacionado->Curioseando Con Units [...]

Instalando el applet Converter en Ubuntu: Linux Music 2.0

[...] La Otra Bola De Cristal Fuente del Script-> Converter Deskbar Enlace Relacionado->Curioseando Con [...]

JohannesBuchner

Hi! I kinda stole this from you and made it 2.20-compatible (new API).

And I changed the link in live.gnome.org.

Feel free to steal it back if you want to update it.

;-) Johannes

sil

Johannes: that's absolutely fine with me! Good work.

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.