Deskbar Extension Converter with Calculator functionality


Ever wanted to get answers to questions like the following?

3 kilometers in meters
6000 gallons in litres
1E+06 au in pc
7*4 EUR in dollars
0x5621*sin(3)+16 euro in dollar
$ 0.50*100/3 in euro
-L- 0.50 in euro
15 kg/m^3 in g/cm^3
3E+09*sin(3)+pow(3,10) kg/m^3 in g/cm^3
3 1000 in 1

And that quickly, from your desktop?

There existed a Converter and a Calculator extension, I made them work together.

Converter-with-Calculator

Download: converterplus-1.9.tar (bz2, 9 KB) converterplus-1.8.tar (bz2, 6 KB)
Howto install:
You have to copy both files from the archive to ~/.gnome2/deskbar-applet/modules-2.20-compatible/, then activate them in the deskbar-applet Preferences.

Old versions of Converter and Calculator will not work together!
You can easily check if you got the right versions: They have my name as author in them and contain the line “This version of calculator can be used with converter” and vice versa.

You need to have the program units installed to benefit from Calculator. It is in your distribution’s repository under the name ‘units’.

Bugs: Please send bug reports by email or leave a comment here.

Technical details:
(users don’t need to read this)

The question was to either copy over the code from Calculator to Converter or to reuse the Module. Code duplication (DRY) was a definite argument against that. If Calculators code gets updated, Converter benefits too. Also, you can enable each functionality seperately.

Problem was to access the other module when loaded in deskbar, I made a hack for loading a file in the same directory, no matter of the context (see source).

  1. #1 by endolith on February 15th, 2008

    :)

  2. #2 by prol on February 16th, 2008

    This app doesnt get priority in deskbar and stays at the bottom

  3. #3 by JohannesBuchner on February 27th, 2008

    REPLY:
    Move it up in the preferences.

  4. #4 by endolith on May 30th, 2008

    REPLY:
    Even if you move it to the very top of the list, the results still show up at the bottom. :(

  5. #5 by endolith on May 30th, 2008

    Adding converter abilities to the calculator is a really great addition, but it isn’t quite as good as Google Calculator. With both, you can do things like “(3 + 500) kilometers in meters”, but you can also do things like “3 kilometers + 500 feet in yards” in Google Calculator, which this Deskbar handler can’t handle.

    *However*, I just realized that GNU units *can* do things like this. Try this command, for instance:

    units -1v “3 kilometers + 500 feet” yards

    So really, instead of doing the calculations in your handler, you could just use Deskbar as a frontend to GNU units, and let it do all the calculations. It can handle all kinds of weird things:

    units -1v “three hundred + seventy million – pi”
    units -1v “5 million pounds” megakilogram
    units -1v “1/sqrt(2*pi*10*microF*100 mH)” Hz
    units -1v “sqrt(mu0/epsilon0)” ohm
    units -1v “sqrt(4 k stdtemp 1 kohm (20 kHz – 20 Hz))” nanovolt

  6. #6 by Paul on October 25th, 2009

    Hi!

    Thanks for a great extension. It’s some really nice features, but unfortunately I’m having problems with it. When I copy the files to the folder (which seems to be /usr/lib/deskbar-applet/modules-2.20-compatible in my case), I’m able to add the extension and it works fine. The next time I boot my computer however, the extension is gone from the extension list. It’s not in the “extensions with errors” list either. The file is still in the folder, but I have to delete it and copy it over again to make it work. I’m using Deskbar-applet 2.26.1 (Ubuntu repository).
    Any suggestions?

  7. #7 by admin on October 26th, 2009

    post on the deskbar mailing list. afaik it is shipped with Ubuntu per default.

(will not be published)

  1. No trackbacks yet.