Welcome to awesome bug tracking system.

FS#978 - capi.lua module for every awesome C API objects

Attached to Project: awesome
Opened by TsT (TsT) - Monday, 19 March 2012, 21:28 GMT
Task Type Feature Request
Category Lua libraries
Status Unconfirmed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version 3.4.11
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No



Awesome provide a lot of lua object in global space (just take a look to the doc)
My work target to move everything outside the global environment.

The capi.lua (and modutils.lua) modules will not break compatibility.
We must change every modules that use the awesome object before thinking about removing the compatibility.

I already successfully tried to modify every lua component to clean the global environment.
But also rewrote lot of thing. For now it's hard to publish clean diff due to huge number of changes.

My next step is to publish sample of use of the capi module.
And after publish the entire diff of beautiful, naugty and every components of awful...

To be continue...
This task depends upon

Comment by Uli Schlachter (psychon) - Wednesday, 28 March 2012, 16:33 GMT
I just had an idea!

Does the attached patch help you? It makes it possible to do require("capi") and get a table where all of the global objects are available.
So far oocairo and oopango are missing (well, they aren't part of capi, but they still should be made require()able).
Also, root, dbus, keygrabber and mousegrabber are missing.

In other words: This is just a proof of concept and I'm not sure if this actually helps with lua 5.2.
For a final version of this, I'd also make require("capi.client") work. (Although... Perhaps this should be require("awesome.client") instead of capi...?)

Please tell me if I should finalize something like that or if I am just breaking your work.