July, 2009


27
Jul 09

First day at the DebConf9

I arrived yesterday at the main venue after a the long trip by car: ~700km in a car without air conditioning. I was very tired so I headed up for my room (which is in an ancient building at the old town area of Cáceres), had a shower and decided to take a nap… with so much success that I slept for two hours and a miracle made me wake up just in time for the Cheese & wine party. It was great to taste an uncountable amount of kinds of cheese, wine and liquors from places all around the world. Among a lot of tasty stuff, it was really enlightening to try out some real japanese sake and the best peanuts I ever tried.

After a quick breakfast today in the morning, my personal schedule included attending the following:

  • Using FOSSology for license analysis in Debian: a tool which determines which license a package has by examining its sources and looking for license disclaimers and similar texts contained in source code was presented. This way even cases where each source file may have a different license can be easily identified. For packagers this makes easier to check whether a software component complies with the packaging policy.
  • Not your grandpa’s debhelper: This one really catched my attention, as I do some packaging from time to time it is very interesting to know about new incarnations of tools which suppose an aid to this task. The new dh thing is able of greatly simplifying build rules. I wanna try it!
  • Debian System Administraors BoF: I thought that it could be interesting to know how systems used for running the Debian infrastructure are configured. Three of the members of the team asked lots of questions from the audience, most of them being about e-mail services and whether it would be possible to improve spam handling.
  • Scratchbox2 for cross-compiling Debian: It was a shame that there was no projector nor something similar for Riku to give an introduction to Scratchbox 2, which looks like a good step forward. For example now it is possible to use it without root privileges at all.
  • Point releases – How to update stable more efficiently: I have missed some bits of this lecture because I was sitting near the end of the room, but if I understood correctly there is a plan for rolling updates sooner into the Debian stable package set by using a repository in the fashion of the Ubuntu “proposed-updates” one, so users can get theirs hands on sooner on the packages in order to provide the needed feedback for stabilization.

After having a light dinner I went along with Diego for a walk along the old town area, to see how does it look at night. The perfect accompaniment was a glass of beer and a magnificent ice cream. And that is enough for today… :-D


24
Jul 09

See you at DebConf9

DebConf9 LogoI will pick up my car and embark myself into a 8-hour trip to reach Cáceres tomorrow in the evening, after 699 km of road trip. The goal: attending (and enjoying!) the ninth edition of the Debian Conference, which has already started. As I do not know exactly the arrival time, I will skip the dinner tomorrow, but I will do my best to be at the Cheese & wine party and bringing some “tetilla” (small breast) cheese from Galicia, which has a funny shape as you can imagine:

I am looking forward to be there tomorrow, as this will be my first time at a big community event and it really looks like this kind of things are really interesting and a great opportunity to get in touch with latest developments, learning lots of new stuff, and meeting people from all around the world… The latter is a must for me, as I will not know anyone there because there will be no more Igalians attending the conference. So if you will be there from 25th to 30th feel free to approach me and have some chat :-D

Last, but not least, shell scripters (and anyone interested) may want to know that have a slot in the unofficial track for a  lecture on Shaft, a tool which we have been using lately to do declarative unit testing of shell scripts. I am just now polishing the slides, preparing a couple of examples and preparing the code for release.

See you there!


16
Jul 09

My own Gtk+ theme

I have never been completely happy with how the widgets of Gtk+ applications looked like. Undoubtedly the “Clearlooks” theme was an impressive improvement, but it has some glitches with some applications (for example Claws-Mail has to be tamed to look good with some themes) and I always had the curiosity of knowing how a theme is made. So I picked up the Chrome theme which uses the Murrine engine, and modified it to have warm gray colors, and the Gnome panel with the same shades as the rest of the widgets. After some tweaking I came up with this:

It makes a smooth, clean environment without too much distractions, apart from the blue shades of the selected items, so it is a good option for everyday use. Especially if you spend loads of hours in front of a computer. It matches nicely with the “Clearlooks” theme included in the latest versions of the OpenBox window manager (which I use).

I think this is nice enough to share, so you may want to get the theme conveniently packaged as a tarball.


14
Jul 09

Embedding widgets from other processes with PyGTK

After discovering the Surf minimalistic web browser, I was just curious on how difficutl would it be to use the XEmbed protocol to wrap it into another application. It is far easier than I thought initially by using the gtk.Socket class which does implement the protocol in a convenient way, for example using the following Python code:

import gtk, sys
 
socket = gtk.Socket()
window = gtk.Window()
window.set_title(u"Embedded widget")
window.add(socket)
 
# Embed *after* inserting the socket in a window!
socket.add_id(int(sys.argv[1]))
window.show_all()
gtk.main()

Save this in a file (e.g. embed.py) and now you can run Surf the following way:

# Running surf with -e will print the X window ID
surf -e -u http://google.com &
python embed.py <window-id>

Easy, wasn’t it? ;-)

(Thanks go to Claudio for pointing out the gtk.Socket/gtk.Plug classes)


8
Jul 09

Making Claws-Mail look better

Those of you who use Claws-Mail in a daily basis and like to tune-up how your Gnome desktop looks by means of the fine themes which are available for it, for sure have noticed the weird, ugly 2-pixel spacing between toolbars and the window border. This not only unpleasant to see, but totally breaks some dark themes (e.g. Dust). The bad news: the padding is hardwired in the Claws source code. The good news: there is a small patch I made which will make your day happier :-D

Update: The patch has been already included in the Claws-Mail repository. Thanks you guys!


3
Jul 09

Light charset detection (mostly CJK)

What happens when you have a pile of text you want to convert to a sane encoding like UTF-8 and you do not know which encoding is being used? In general, you have two options:

  • Trying all possible encodings. This may be more or less difficult depending on the language in which the text is written: some languages can be written in a number of encodings. For example encoding covering cyrillic characters is a mess: Macintosh Russian encoding, Windows CP1251, KOI-8 (and several variants of it), ISO 8859-5…
  • Asking the author of the text. This may not be feasible at all, as you may even happen to not know who the author is :-(

But there is another option: detect it programmatically. This one of the things that Enca can do for a variety of languages. But, just for a second, imagine that you want a similar funcionality using a lighther approach, and you are mostly handling Unicode and CJK text (Chinese-Japanese-Korean) in different encodings, and you prefer a lighter solution than Enca… enter GChardet, a wrapper on top of the Mozilla encoding detection routines (as used e.g. by Firefox) with a plain C interface designed to blend nicely with code using Glib.

This is a nice hack I did in a couple of hours by adding some definitions in fake header files, because the detection code is not totally isolated from the rest of the Mozilla code base. Also, to provide the C-only API I had to make some subclassing and override a pair of methods. After that, adding the “G-frienly” API on top was straightforward. The thing I like most about this solution is that it can be compiled to a small library of ~120kB in amd64, and the original Mozilla sources were not touched at all.

Just in case this could be useful for someone else, I have uploaded it to Gitorious. Feel free to clone the repository, use it, and provide feedback. By the way: as this uses Mozilla code, I have set the license to MPL.


2
Jul 09

Gentle CSS3 support in Gecko

Today I updated XulRunner to version 1.9.1 (with accompanying updates to Epiphany 2.26.3 and Firefox 3.5), and made a little experiment which I do everytime a web browser get updated: surf to css3.info and check whether some CSS3 cool stuff which was previously unsupported works with the latest release.

This update brought in the following improvements:

  • Text and box shadows, to make the browser generate more bling with less tricks.
  • HSL and HSLA color spaces, essential for conveniently creating shades of the same colour, by changing the saturation and/or lightness.
  • Some new background positioning options.
  • Multicolumn layout. I still do not have a clear idea if I would like use this in a web design, but I feel like it will be superb for generating printed media.
  • At last: TrueType fonts loaded from the web!
  • Other minor niceties :-D

I find very appealing that browsers are finally getting some of this implemented, especially drop shadows and fonts loaded from the web, as they allow designers for crafting very interesting designs while keeping sites accessible. Especially with web fonts: it will be no longer necessary to pre-generate titles and the like as bitmaps or generating them server-side. Something as simple as a good font design can turn a boring website into something beautiful, so this having feature (for now in Safari/WebKit and Firefox/Gecko) is absolutely thrilling.

Good times for web design are coming… ;-)