awesome 3: Lua integration
Par jd le mardi, mai 20 2008, 22:22 - awesome - Lien permanent
I must admit that the "no complicated configuration file" was an advantage for most users of awesome, but well, it was not possible to continue on this path.
As I explain in a mail on the awesome mailing-list, integrating a high level language for handling configuration was becoming necessary.
So I did it, I wrote a 10K lines patch (about +3K/-6K SLOC) that just drop all the libconfuse configuration handling and now export a Lua API. It took me about two weeks to complete this task, so it was not really hard. And I am so fucking happy that the code base is now even lighter (3K SLOC less for doing more!).
The Lua API is sometimes a PITA to understand, because there seems to be a lot of functions more or less connected or doing the same thing, and the separation between the core and the aux library is not always clear to beginners. But in the end, it's a language really easy to integrate, and very easy to learn. Lovely.
Now it's possible to do almost everything possible in awesome, since you can now have conditional configuration and hooks to do stuff on events (i.e. change window border size on focus, toggle title bars when switching to floating layout, …). The configuration file format and syntax is I guess still clear.
You can also execute Lua code on the fly and manipulate objects, like I did in this small video demonstration recorded a few days ago.
Commentaires
Awww. I liked awesome so much for not embedding a scripting language. I would have rather seen some C library or messaging interface (D-BUS, for instance) for poking awesome objects dynamically, with various language wrappers around it. Instead, you've embedded one particular language into awesome.
To be honest I think you waste your time with Lua.
In dwm I initially decided to go with C-based configuration because of exactly the reasons why you are now switching to Lua -- having conditional setups, extending the functionality etc.
If you don't like compile-time setups, you should consider that it's easy to recompile the window manager whenever you start/restart from a script or even just running it in a C interpreter (tcc provides this for example, you don't need to compile the whole stuff as a binary at all).
The nice thing about this is, you get rid of yet another clunky dependency - which is a different language -, but you achieve the same, in the same language your software is written in... That's far more natural than going the complex way like Tuomo did and others before...
Just my 2cts.
Wow... now I have to find yet another WM that does not go overboard with nonsense. First Tuomo goes bonkers, now you add Lua... and DWM is just a wannabe-elitist group of hackkzorzz.
What is so hard about delivering a tiling wm with a set feature-list, like all of the non-tiling-wms have?
Why not add a plugin-System and leave the rest alone?
I am really really disappointed with this decision.
awesomeUsers--;
I know that people are afraid of Lua style config file.
Well, if you think that the default configuration file is not clear and easy, well, I cannot do anything for you.
Just fork awesome 2 branch and do your own!
PS: I never understood the Ion configuration file neither.
The conclusion of the above-said can only be (in my case): /bye awesome
And that is really a great pity.
A fork. Yes, that would be nice. One awesome for the users, the ordinary people
and one for those high-class ingenious hackers.
The lua integration is just great and very clean thing.
Besides it allows to do things, you can't at all without.
It's still possible to have a awesome-2 like 'awesome-wm'. The conversion from the old config to the new one, is as easy as 123 - e.g. could be make automatically even..
(I personally have no loops in my lua configuration to keep it even more simple. Only simple one-line statements more or less. A loop may needs somekind of thinking, what I don't like to do there
(ignore the typos etc. please.. on the above message)
Between switching to autoconf, doxygen bloat and this Lua shift, this makes dwm look user-friendly. So I switched to that. Awesome is a nice OS, but I prefer UNIX.
lua ist ugly. and it's not so simple

implement in some proper stuff
In wmii i can decide, what for language i take. Lua must not necessarily be include in WM. I wuld see now, what can i do whith wmii
dwm is cool :D