Private fork of https://github.com/awesomeWM/awesome
4ab499fe26
The patch is mainly to export client_array_t object to Lua, but can be used to export any ..._array_t object. The idea: export to Lua not a table, but userdata with metamethods to get/set/define length of ..._array_t object directly. Now when I get clients field from tag object C code creates full copy of client_array_t structure into Lua table. It takes traversing a whole array of data. I did it in other way: userdata is exported, with __index, __newindex, and __len meta-methods defined, and Lua script gains direct access to client_array_t C-array: it can get client object, get length of array and assign client objects to some index in C-array. Pros: No overhead of creation a copy of C-structure into Lua-table: if I want just to test a number of clients for a tag, I don't need a whole loop to build table, I just want to read clients->len field, and I do so via __len meta-method. Also if I want to get some client from tags.clients, I don't need to create ALL clients Lua-objects, I just get client_t C-struct and create Lua-object from it. Just in place. So Lua-loop enuming all tag.clients is not 2 loops internally (first create copy of tag.clients into Lua-table, then enum this table), but only one, and if I break out of loop in the middle, I create only some client Lua-objects, not all of them from tag.clients. Contras: As far as clients field is not a table, I cant use pairs/ipairs and other table functions for it. But it can be implemented in other way: for k,c pairs(tag.clients) => for k = 1, #tag.clients, table.insert(tag.clients, client) => tag.clients[#tag.clients+1] = client etc. One more Pro now: As far as tag.clients in current implementation returns copy of data table.insert doesn't do what's expected: it doesn't really add client into tag.clients "array". With my implementation client is added as expected, as we work with client_array_t structure directly. Signed-off-by: Julien Danjou <julien@danjou.info> |
||
---|---|---|
build-utils | ||
common | ||
icons | ||
layouts | ||
lib | ||
themes | ||
widgets | ||
.gitignore | ||
AUTHORS | ||
BUGS | ||
CMakeLists.txt | ||
LICENSE | ||
Makefile | ||
README | ||
STYLE | ||
awesome-client.1.txt | ||
awesome-client.c | ||
awesome-version-internal.h.in | ||
awesome.1.txt | ||
awesome.c | ||
awesome.doxygen.in | ||
awesomeConfig.cmake | ||
awesomerc.5.txt | ||
awesomerc.lua.in | ||
client.c | ||
client.h | ||
cnode.c | ||
cnode.h | ||
config.h.in | ||
dbus.c | ||
dbus.h | ||
event.c | ||
event.h | ||
ewmh.c | ||
ewmh.h | ||
keybinding.c | ||
keybinding.h | ||
keygrabber.c | ||
keygrabber.h | ||
layout.c | ||
layout.h | ||
lua.c | ||
lua.h | ||
mouse.c | ||
mouse.h | ||
placement.c | ||
placement.h | ||
screen.c | ||
screen.h | ||
stack.c | ||
stack.h | ||
statusbar.c | ||
statusbar.h | ||
structs.h | ||
systray.c | ||
systray.h | ||
tag.c | ||
tag.h | ||
titlebar.c | ||
titlebar.h | ||
widget.c | ||
widget.h | ||
window.c | ||
window.h |
README
awesome ======= awesome is an extremely fast, small, and dynamic window manager for X. Requirements ------------ In order to build awesome itself, you need header files and libs of: - cmake - Xlib, xcb and xcb-util (>= 0.2.1) - Lua 5.1 - cairo - pango and pangocairo - libev - glib - GdkPixBuf or Imlib2 (use -DWITH_IMLIB2=ON with cmake) - dbus (optional, use -DWITH_DBUS=OFF with cmake to disable) - gperf In order to build the awesome man pages and documentation, you need these tools: - asciidoc - xmlto - docbook XSL stylesheets - luadoc In order to build the source code reference, you need these tools: - doxygen - graphviz Building and Installation ------------------------- After extracting the dist tarball, run: make This will create a build directory, run cmake in it and build awesome. After the building done, you can type this to install: make install # might need root permissions Running awesome ----------- Add the following line to your .xinitrc to start awesome using startx or to .xsession to start awesome using gdm/kdm/xdm...: exec awesome In order to connect awesome to a specific display, make sure that the DISPLAY environment variable is set correctly, e.g.: DISPLAY=foo.bar:1 exec awesome (This will start awesome on display :1 of the host foo.bar.) Configuration ------------- The configuration of awesome is done by creating a $XDG_CONFIG_HOME/awesome/rc.lua file. An example is provided in the sources.