Showing posts with label usage meter. Show all posts
Showing posts with label usage meter. Show all posts

Thursday, October 2, 2008

Creating a custom theme for Net Usage

This article will provide a walkthrough on how to modify the netusage.svg file to create a custom theme for Net Usage.

In order to modify an SVG file we will first need a program to open the file, the program I use and recommend for this is Inkscape, a free and open source vector graphics editor.

This walkthrough is based upon the theme I created to extend the length of the usage bar as posted on this Whirlpool forum thread: http://forums.whirlpool.net.au/forum-replies.cfm?t=803008&p=37#r737.

  1. In the Firefox location bar enter "about:netusage?theme" and press Enter.
  2. When the Net Usage Theme Building Wizard page is displayed click the New/Open button and select or create a project directory.
  3. A new file has now been created in this directory called netusage.svg; we open this file in Inkscape.
  4. We can now see each element which makes up the Net Usage bar, to extend the length of the bar we first need to increase the size of the document. Click File > Document Properties on the menu bar of Inkscape, in the dialog box which appears we can increase the width of the document, I chose to increase this to 180 px however you can choose any width you wish, we can close this dialog box.
  5. Now that we have increased the documents width we can resize the usage bar. Click on the dark grey border of the outer rectangle and then using the right hand side drag handle increase the width of the bar, now repeat this step for the inner rectangle.
  6. Now we need to adjust the clipping of the usage bars themselves, to do this we need to open Inkscape's XML Editor (Shift+Ctrl+X) and take note of the inner rectangles new width (see screenshot), these figures may differ if the rectangles have been resized freehand. This width is what we must adjust our clipping by minus approx 1 px (the stroke width of the inner rectangle).
  7. Enter this new clipping width minus approx 1 px and click set (see screenshot).
  8. Now we can resize the usage bars themselves, don't forget to resize the green and blue bars to the left initially to expose the orange and yellow bars which represent usage over 100% of peak and off-peak quota respectively.
  9. Move the percentage label over and save the file. The next step is to package the file using the wizard.
  10. Click Load under the Test section of the wizard, if you are happy with your theme move to the next section of the wizard and fill in your theme package information, finally click Make Dist under section 5 of the wizard.
  11. The final step is to zip the contents of the distribution folder using whatever zip program you wish, I use and recommend 7-Zip another free and open source program. Once zipped the file should be renamed to end with the file extension of .xpi.

Congratulations you have just created your own custom theme for Net Usage. Although this walkthrough only covered extending the length of the usage bar, any number of custom themes can be created by making additional modifications to the netusage.svg file, so get creative and see what you can come up with.

Monday, December 17, 2007

Welcome All

Hi everyone! Welcome to my blog on Net Usage.

A couple of weeks ago I downloaded and installed the Net Usage add-on for Firefox. This add-on polls your ISP's usage page and displays your usage in a small graph in the toolbar.

"So what, there are heaps of internet usage programs out there." Yes there are, but the simplicity of this one is what makes it so good. It doesn't track usage on your computer, or try to track usage across the network. It just polls the ISP's page and reports back what the ISP has recorded on your account.

The other outstanding feature of this add-on is the author, Critter. He provides an amazing amount of support via the Whirlpool forums. In particular, this thread. I don't know how he finds time to support all the requests for ISP additions and fixes due to ISPs changing the format of their usage pages.

After installing Net Usage on my sister's computer for her Optus account, I decided to install it and try to modify the ISP file to work with my ISP (iSage). Critter provides all the source code via svn from his svn repository. I have never modified a mozilla add-on or programmed in Javascript. It took me a few days to figure it out but I eventually got it working.

I offered to provide Critter with a dedicated forum for people to discuss Net Usage. However, he is happy with the forums at Whirlpool and not convinced dedicated forums will work better than what he is currently working with. I've decided to create this blog to document what I've learnt and hopefully assist other people add their ISPs or modify their ISP configuration when it suddenly stops working.

Please post comments and point out error's in my posts. As I said, I have never programmed in Javascript so I am expecting to get a few things wrong and am relying on you guys to help me out.

May I finish this post by encouraging everyone using Net Usage to donate a couple of buck to Critter for all his work. He has a donate button on the bottom of his page.