jd:/dev/blog

Aller au contenu | Aller au menu | Aller à la recherche

jeudi, janvier 29 2009

What's new in awesome 3.2

We're working since several month on awesome 3.2, and here is what you'll get soon:

  • By wibox X cursor;
  • New mousegrabber infrastructure;
  • Client move with mouse is now in Lua;
  • New D-Bus hooks; you can also watch D-Bus events to get information like the song played in Audacious, or things like that;
  • naughty (notification library) now supports notification via D-Bus, following standard notification protocol;
  • Layout code moved to Lua;
  • Client gets a new mouse_leave hook;
  • Floating state is now handled on Lua side;
  • Windows groups are handled and exported to Lua API;
  • Various awesome markups have been removed in favor of widgets properties (simpler);
  • Shadow support has been removed (too buggy);
  • Add new telak module (draw image from the Web on your root window);
  • Add mouse move code for wiboxes;
  • Add functions to move clients with mouse to tags via the taglist;
  • Add support for key release events in keybindings;
  • Add support for input faking into client via XTest extension;
  • Add support for X selection retrieval (clipboard);
  • Add support for real transparency attribute on wiboxes;
  • Replace tile layout by a new layout (originally called 'vile') which supports resizing of slaves clients.

We've done a nice job. :-) Thanks to all contributors! See you soon for the first release candidate version…

startup-notification port to XCB

Since Tuesday, I've begun to work on XCB portage of the startup-notification library.

I've just completed the job, and send a bunch of patches to the XDG mailing list. My work is available in my startup-notification git repository.

If the patches are merged, which I don't doubt, I'll be able to use this lib into awesome, which would be nice step to the Freedesktop standard compliance I like to make.

jeudi, janvier 22 2009

Dear Pablo

You feel old?

You are not.

You may just be one aged enough geek that have a good overview of the IT world. So you see that this are only trends and fashion tech.

Technologies qualified by some as "old" are in fact still the more robust and efficient ones for people mastering them.

Why do you think there still many people not using things like KDE or GNOME, using Emacs or vi instead of Eclipse? :-)

You're the one who knows how to make a quick'n dirty tunnel with ssh and ppp. They're the ones lost with the latest release of Checkpoint.

mercredi, janvier 7 2009

The ignorance test

This is one of the most stupid test I ever encountered. It seems this sort of things happens when you have no clue about the technology you are talking about.

Just imagine the famous Road Runner. This benchmark is about measuring how fast is the animal below:

Meep meep!

Yeah, indeed, this is not a Road Runner.

mardi, décembre 30 2008

Rants about Lua

I've started using Lua some months ago, while looking for a more powerful way to configure awesome. At this time, around March 2008, Lua seemed to be the best language to integrate inside the core system of awesome.

I still think that Lua was a good choice, but after 8 months, it shows some important drawbacks.

I'll try to keep my explanation simple and to make you understand everything, even if you do not know Lua.

I refer here to Lua 5.1

Design flaws

Length operator

Lua has a length operator on its objects, known as #. It can be used to get the size of various objects.

return #"lol" 3

This operator works for table, string, etc… It's possible to define this operator by setting a __len meta-method on a userdata value.

The problem is that you cannot redefine it on string or table objects, see:

> a = { "hello", "world" }
> return #a
2
> setmetatable(a, { __len = function () return 18 end })
> return #a
2

Indeed, looking at the Lua core code:

     case OP_LEN: { 
       const TValue *rb = RB(i); 
       switch (ttype(rb)) { 
         case LUA_TTABLE: { 
           setnvalue(ra, cast_num(luaH_getn(hvalue(rb)))); 
           break; 
         }   
         case LUA_TSTRING: { 
           setnvalue(ra, cast_num(tsvalue(rb)->len)); 
           break; 
         }   
         default: {  /* try metamethod */ 
           Protect( 
             if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN)) 
               luaG_typeerror(L, rb, "get length of"); 
           )   
         }   
       }   
       continue; 
     }

You clearly see that tables and strings always use the internal length operator, never the __len meta-method.

That's for me a design problem, which will cause more trouble. We'll see later.

__index and __newindex metamethods

Lua defines two useful metamethods, which are __index and __newindex. Both can be set on a table or any other object. __index will be called upon each read access to an undefined key on an object, and __newindex upon each write access.

Example

> a = {}
> setmetatable(a, { __index = myindexfunction, __newindex = mynewindexfunction }) -- function are not defined, this is just an example
> a[1] = "hello" -- This will call __newindex metamethod
> return a[2] -- This will call __index metamethods
> return a[1] -- This will NOT call __index

The last line does not call __index meta-method because a[1] does exists. This is a problem when you want to use table as object, because sometimes you want to monitor access to the table elements.

This can be easily worked around using a proxy system: you don't store things in the table you manipulate, but in another table.

> a = {}
> realtable = {}
> setmetatable(a, { __index = myindexfunction, __newindex = mynewindexfunction }) -- function are not defined, this is just an example

Where meta-methods are something like:

function myindexfunction(table, key)
   return realtable[key]
end
function mynewindexfunction(table, key, value)
   realtable[key] = value
end

This way, our a table will always be empty, and realtable will have the data. At every read or write access to a, the meta-methods will be called. This is very convenient and widely used hack.

But this has serious drawbacks: as we saw before, the length operator (#) cannot be redefined on a table. That means #a will always be 0, and you cannot get the table length anymore, except by defining another method or a special attribute.

Also, Lua has several functions in the table library that are used to manipulate table in a easy way. The problem is that standard functions like table.insert or table.remove do raw accesses to the table. Meaning that if you do table.insert(a, 1, 1) it will insert the value 1 at the key 1 into a, without calling the __newindex meta-methods, breaking all your beautiful object-oriented model.

Another solution is to use a userdata object, like done in the Lua newproxy function (which is under-documented).

The problem is that it breaks all the other functions that are waiting for a table as argument, because they see a userdata, not a table. So this time table.insert is now more usable, which somehow fixes the problem, but not in the right way IMHO. However, this allows to use the __len meta-method.

Development model

The development model of Lua is, from my point of view, non-existent.

There is no public version control system repository available, so there's no chance to really contribute to Lua. It seems only a defined set of people work on it and therefore, the development system is very closed to my eyes, in comparison of usual projects.

Conclusion

I still think Lua is a good choice, because it is very easy to integrate into any C program, and to expand to fulfill your needs. However, some bad design choices were made, and the poor and closed development model chosen does not allow to have a good overview of the future of Lua.

This has been well stated by the authors themselves.

vendredi, décembre 12 2008

Using a Bluetooth headset under Linux

… is a no.

It just does not work. I mean, it does work if you want to listen to music using mplayer in 8 KHz quality, but don't even think to use it to phone using SIP.

I've first tested with bluez 3 which is part of Debian. It roughly work, but sometimes it stops working and you have to restart hcid, or to clean its cache. Not very stable.

I've then tried using bluez 4, compiled from scratch. It works much better, i.e. I can run mplayer a thousand of times without having it stopping to work, but I'm totally unable to use it with twinkle or ekiga.

And I don't even talk about ekiga still unable to set a custom ALSA output. I even try to hack it via gconf-editor!

That's really a shame.

mercredi, décembre 10 2008

telak in awesome

Some years ago I wrote a little tool called telak in order to display remote images on my wallpaper and have them updated regularly.

Yesterday, as a challenge, I rewrote this as an awesome module, in Lua using wget. I simply used a wibox and a widget from awesome API to display the images.

It's called telak, as the original, and is in the awesome next git branch, which will be the 3.2 version of my favorite window manager.

Telak

dimanche, novembre 23 2008

Mozilla is getting me mad every day

Now you need to register to install addons from addons.mozilla.org. For god's sake, what's the point of such a thing, except annoying people.

Mozilla you suck: your softwares suck, your ideas suck. You'll really gonna get out of my computer ASAP.

samedi, novembre 22 2008

Security bug found in Imlib2

Yeah, I'm the proud discover of CVE-2008-5187.

It's my first time, it does mean something to me. ;-)

vendredi, novembre 21 2008

Implementing desktop notification in awesome

Since version 3.1, awesome is bundled with naughty, a notification library which allow to raise pop-up in front of the screen to display information you chose. A sort of notification-daemon, but not plugged into D-Bus.

Last days I've began to work on awesome 3.2 (aka the 'next' branch in awesome repository). I've started to chat with Leon Winter on IRC about the possibility to implement notification specifications into awesome.

awesome had since version 3.0 a very light D-Bus support, since it only allowed to evaluate Lua remotely, without getting an answer anyway.

I've hacked it so now there's a D-Bus hook, which is called upon a D-Bus message received. This, plus the possibility to return various data type (not all are implemented as of this day) allowed Leon to enhance the naughty library and to add support for a primary notification support.

I just have to add more D-Bus data type support, and we may be able to support all the specs, with icons support, etc.

vendredi, novembre 7 2008

First release candidate for awesome 3.1

is out.

mardi, novembre 4 2008

New poster

I've received my new poster.

awesome poster 1 awesome poster 2 awesome poster 3

jeudi, octobre 23 2008

Quarter

I've just turned up a quarter of century. :-)

mardi, octobre 21 2008

Debian bug sprint

I want cookies.

awesome 3.1: more changes

A lazy morning again, so you'll enjoy another short list of changes in the upcoming awesome 3.1 (first one is still here):

  • Text can now be spread across multiple lines, using pango ability to wrap text;
  • New full screen layout;
  • awful.clients.swap.bydirection function;
  • Images get crop_and_scale() method;
  • New module: invaders, a space invader game;
  • New module: naughty, notification module (like GNOME's notification-daemon);
  • More hooks: "clients" for client list changes, "tags" for tag list changes and "tagged" for client's tag list changes;
  • Wiboxes's widgets can now be composed of arrays of arrays, specifying a DAG structure, unless of a simple array. A reference is kept to it so it can be retrieved later. Any array can be modified with awesome being notified using a proxy table system.
  • Taglist and tasklist widgets are gone from core and are now written in Lua, using the above system.

Not too much changes, I've spent something like a week thinking and writing the 2 last points. I've now a bunch of things to finish and I think we'll go for a RC release in something like a couple of weeks.

vendredi, octobre 10 2008

Space invaders for awesome

I was sure it will be possible.

With current awesome git version it's possible to run a space invaders game.

Space invaders

With only 380 lines of Lua.

Is there any window manager capable of doing this ? ;-) And don't say it's useless!

Thanks to Gregor "farhaven" Best for wasting his time with that.

Nada Surf at Olympia

Tuesday evening I was at the Olympia to see Nada Surf, the french New York guys, on tour. The show was very nice. I've already saw them 2 years ago, and it was already very cool, so nothing new.

They played lots of different songs from all albums. I really appreciated this since I'm not a big fan of their latest ones. That was funny to see most bitches fidgeting on their seats when they played some recent successful songs and becoming totally quiet and passive when they announced that they were going to play Telescope from Karmic (a EP from 1995 before their first album).

But well, that still was a great show and was pleasant to be there.

vendredi, octobre 3 2008

The eggtray problem

I still don't know why but many GTK+ applications use something called eggtrayicon. As far as I know, eggtrayicon.c is a file written in 2002 by Anders Carlsson which implements the Freedesktop.org system tray procotol for GTK+ applications.

Problem is that this C file is used in dozens of programs and maybe more, and is a bit bugged. I've already send patches for mail-notification and Audacious. pidgin is the first fixed implementation I found and works quite well. Many other applications are probably affected.

That seems to me like a real problem. Multiple copy of bad code instead of using native GTK+ system tray implementation.

So please stop using this bad implementation…

mercredi, octobre 1 2008

First awesome 3.1 changes

I'm lazy this morning, so I'll write a quick changelog about what's coming next in awesome 3.1, as of now.

  • awesome-client is now a true REPL: so it now returns things like errors;
  • mouse events now support button release;
  • awful has been splited in several modules;
  • the window stacking has been reworked and handled special windows (dock, desktop) much better;
  • window type is now exported and correctly handled;
  • any window can go fullscreen;
  • widget can get an event when the mouse enters in it;
  • placement (smart, under_mouse, etc) has been move into awful;
  • statusbars and titlebars has been merged in a common type: wibox;
  • wibox can be floating (i.e. you can now write your own conky-like with wiboxes);
  • _NET_WM_STRUT_PARTIAL is now supported so panel and dock automagically puts padding around the screen;
  • sticky windows are handled like sticky windows and are not tagged anymore;
  • windows that get reparented are now unmanaged (that fixes view of PDF etc in your browser);
  • a new image type has been introduced so you can manipulate image directly in awesome and use them;
  • a new imagebox widget has been (re)introduced to use image objects;
  • a real minimize/iconify state is now available;
  • awesome gets a --check to check Lua syntax file; restart is now also checked for syntax file by default.

And of course some bug fixes. :-)

jeudi, septembre 18 2008

awesome 3 released

I just released the final version of awesome 3.

I'm very happy to see all this work (6 months, over 1K patchset) and time spent on this piece of code being wide used and much appreciated. This last months were amazing and very exciting.

Thanks everyone for using it or contributing to it. You rock (too).

Let's go for awesome 3.1 now…

- page 2 de 25 -