Laptop battery consumption / learning gnuplot

Today I tested how long my laptop’s battery can last when I just keep it on the table, idling. Running Linux and a bunch of applications, the TFT set to the lowest brightness setting. Wireless activated.

After the laptop switched off, I plotted the power consumption curve with gnuplot, which I wanted to get to know for a long time already πŸ˜‰ The data file (fed from /proc/acpi/battery/BAT1/state) contained 1678 data points (ten samples per minute). The gnuplot session looks like this:

gnuplot> set terminal png picsize 800 600
Terminal type set to 'png'
Options are 'small color picsize 800 600 '
gnuplot> set output "test.png"
gnuplot> plot "powerlog3" using 1:2 title 'Power consumption (W) over time (min)' with lines, "powerlog3" using 1:3 title 'Remaining (%) over time (min)' with lines smooth unique

You can see the result here:
Plot of my laptop’s power consumption, tested on 2007-06-10, plotted with gnuplot

In the beginning I finished something I was working on, so you can see some spikes in the power consumption when I launched programs and such… After 60 minutes the monitor switched off, so the consumption drops. I guess I hit the table at minute 144 or so, because then the monitor seems to have switched on again, don’t remember though πŸ˜‰

I’ll do the test running Windows at a later time – but there I will only get one number – the total runtime. I have no idea how I could get statistics like that in Windows, and I’m not willing to try 10 shareware programs until I get a suitable result πŸ˜‰

UPDATE (2007-06-11):
I got around running the test in Windows. I tried to produce about the same conditions: display switches off automatically after 60 minutes, no automatic standby and stuff. I also remembered to switch on the display again after ~70 minutes of being switched off, so the results should really be comparable. One of the apps I kept running on the otherwise idle system was a PuTTY window. Therein I ran a shell script on my server, which touched a file every ten seconds, so I just would have to check the modification date of that file to know when the box went down. I started the test at 11:01 local time, which means 3:01 UTC. The file’s modification date is: 2007-06-11 05:22 (UTC). –> The laptop was shutdown automatically after 2:21h.

So it’s definitely not true that there is some energy wasting going on when Linux is running on a computer, as I have been told (and which eventually caused me conducting this experiment πŸ˜‰ ). If anything, Windows lost here, as usual.

P.S.: Some information about the two software environments:
Linux: Kernel 2.6.21-gentoo-r2, (for details, have a look at my current configuration). On top of it, running Xorg, KDE with Beryl as window manager, there are usually about 150 processes in the task list.
Windows: Windows Vista Business, everything left quite to the default (I never use it…). No special services running or anything.

RedHat Liberation Fonts

Today I discovered that RedHat released a set of fonts under GPL which are approximately metrically equivalent to the most used Microsoft fonts.

Arial ~ Liberation Sans
Times New Roman ~ Liberation Serif
Courier New ~ Liberation Mono

The Liberation fonts are not yet complete (no full hinting, yet), still they look quite good already, in my opinion. The fonts will be complete at the end of this year.

Read more here: RedHat’s announcement

Download the package containing the three truetype fonts here: Download

Thanks to RedHat! πŸ™‚

There is still one thing though: We should have a free font like “Arial Unicode MS”, containing all the characters you can think of… right now I still have to use Arial Unicode MS as fallback substitution, because there are only very few chinese characters in the Liberation fonts.

UPDATE (2007-06-13):
A small sample of the Liberation Sans font, rendered by Qt / KDE with anti-aliasing and full sub-pixel hinting (RGB), hinting style: full:

Sample of the Liberation Sans font

Discovered Google Translate

Some days ago I discovered Google Translate, Google’s automatic translation service. I’m aware that it’s not exactly new, and for example babelfish has been there for years, supplying us with extremely bad and most of the times quite amusing translation of websites – but the news is: Google Translate knows Chinese! I have been using Worldlingo for that for a long time, but this website is often very slow and full of advertisement. I can’t judge which translation engine is better though.

Oh, and the best thing: Google Translate can be integrated into your browser πŸ™‚ Here is how:
For Konqueror, go to Settings / Configure Konqueror… / Web Shortcuts and press the New… button. Now you can specify a name for this web shortcut, for example “Google Translate english/chinese” (this is the name as it shows up in the web shortcuts list). Then, paste the following into the URL field:
http://translate.google.com/translate_t?hl=en&ie=UTF-8&text=\{@}&langpair=en|zh-CN
Finally, specify the web shortcut itself, for example “ench”. From now on, you can just type “ench some english text” into your URL entry field, and the translation will be made. If you have a closer look at the URL I specified above, I’m sure you’ll be able to figure out how to add a web shortcut for chinese/english or any other language that Google Translate supports πŸ™‚
For Firefox, download the appropriate search plugins from mycroft.mozdev.org and use the search field next to the URL field.

On a side note: My website is now available in eight (!) languages. Five thanks to Google Translate πŸ˜‰

P.S.: . o O ( Hmm… that URL is long and doesn’t get wrapped. So now it overlaps the menu on the right. Man that looks ugly. I should tweak this theme a bit, I guess… Nah, too lazy. )