Converter 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:

Does this only work for a specific version of Deskbar? I have 2.14.2 (Ubuntu 6.06) and it’s not doing anything.
15 hours later
joeljkp: that’s the version I’ve got. Have you enabled the plugin in the preferences window for Deskbar?
24 hours later
Ah, forgot about that. Thanks!
44 hours later
Your download link above is broken, it gives a WebDAV error: “Could not open the requested SVN filesystem”.
11 weeks later
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.
22 weeks later
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.
28 weeks later
I’ll take a look when I upgrade to feisty, which will be shortly.
28 weeks later
Hi
Just alter line 14 of the script. Turn
import deskbar.Handler, deskbarinto
import deskbar.Handler, deskbar.Matchto 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 :)
36 weeks later
The suggestion from papo don’t work for me in Feisty.
Converter is always hidden.
37 weeks later
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:
Providing your output would be a big help to whomever is going to debug this.Loading module 'Converter' from file /home/mathias/.gnome2/deskbar-applet/handlers/converter.py.
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.
37 weeks later
Great stuff. Thanks for that.
Any way to make it support the “€” character for euros ?
37 weeks later
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. :)
37 weeks later
Thanks zanglang–that worked perfectly!!
39 weeks later
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.)
48 weeks later
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.
48 weeks later
[...] 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. [...]
49 weeks later
[...] Fuente-> La Otra Bola De Cristal Fuente del Script-> Converter Deskbar Enlace Relacionado->Curioseando Con Units [...]
49 weeks later
[...] La Otra Bola De Cristal Fuente del Script-> Converter Deskbar Enlace Relacionado->Curioseando Con [...]
72 weeks later
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
74 weeks later
Johannes: that’s absolutely fine with me! Good work.
74 weeks later