From 44f64eee58f20717d9508360641a775d0b4b2459 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 22 Aug 2010 17:01:28 +0200 Subject: [PATCH] Automatically load oocairo and oopango on startup Signed-off-by: Uli Schlachter --- awesomeConfig.cmake | 2 ++ luaa.c | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index c657d4cc..fba2c678 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -136,6 +136,8 @@ pkg_check_modules(AWESOME_REQUIRED REQUIRED x11 pango>=1.19.3 pangocairo>=1.19.3 + oocairo + oopango xcb-randr xcb-xtest xcb-xinerama diff --git a/luaa.c b/luaa.c index 45d5e74b..44009f68 100644 --- a/luaa.c +++ b/luaa.c @@ -29,6 +29,9 @@ #include +#include +#include + #include "awesome.h" #include "config.h" #include "objects/timer.h" @@ -800,7 +803,24 @@ luaA_init(xdgHandle* xdg) lua_pushliteral(L, ";" AWESOME_LUA_LIB_PATH "/?/init.lua"); lua_concat(L, 3); /* concatenate with package.path */ lua_setfield(L, 1, "path"); /* package.path = "concatenated string" */ - lua_pop(L, 1); /* pop "package" */ + + lua_getfield(L, 1, "loaded"); + + /* Load oocairo */ + if (luaopen_oocairo(L) != 1) + fatal("Loading oocairo failed"); + lua_pushvalue(L, 3); /* Copy the module */ + lua_setglobal(L, "oocairo"); /* Set the global entry */ + lua_setfield(L, 2, "oocairo"); /* Make it require()able */ + + /* Load oopango */ + if (luaopen_oopango(L) != 1) + fatal("Loading oopango failed"); + lua_pushvalue(L, 3); /* Copy the module */ + lua_setglobal(L, "oopango"); /* Set the global entry */ + lua_setfield(L, 2, "oopango"); /* Make it require()able */ + + lua_pop(L, 2); /* pop "package" and "package.loaded" */ signal_add(&global_signals, "debug::error"); signal_add(&global_signals, "debug::index::miss");