From 292f09bb939f884c28e7912498ee12020698d3ef Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 13 Nov 2008 15:11:37 +0100 Subject: [PATCH] luaa: add support for conffile in index Signed-off-by: Julien Danjou --- common/tokenize.gperf | 1 + lib/awful/util.lua.in | 2 +- luaa.c | 20 ++++++-------------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/common/tokenize.gperf b/common/tokenize.gperf index 6c45bec91..d5ef9be98 100644 --- a/common/tokenize.gperf +++ b/common/tokenize.gperf @@ -17,6 +17,7 @@ client color Control coords +conffile Ctrl east ellipsize diff --git a/lib/awful/util.lua.in b/lib/awful/util.lua.in index 39ec5127a..18070fb33 100644 --- a/lib/awful/util.lua.in +++ b/lib/awful/util.lua.in @@ -128,7 +128,7 @@ end -- If it's not ok, the error will be returned. -- @return Never return if awesome restart, or return a string error. function restart() - local c = checkfile(capi.awesome.conffile()) + local c = checkfile(capi.awesome.conffile) if type(c) ~= "function" then return c diff --git a/luaa.c b/luaa.c index 3c782e1e0..95863300d 100644 --- a/luaa.c +++ b/luaa.c @@ -166,19 +166,6 @@ luaA_font_set(lua_State *L) return 0; } -/** Get configuration file path used by awesome. - * \param L The Lua VM state. - * \return The number of elements pushed on stack. - * \luastack - * \lreturn The awesome configuration file path. - */ -static int -luaA_conffile(lua_State *L) -{ - lua_pushstring(L, globalconf.conffile); - return 1; -} - /** Set default colors. * \param L The Lua VM state. * \return The number of elements pushed on stack. @@ -748,6 +735,9 @@ luaA_mouse_add(lua_State *L) /** awesome global table. * \param L The Lua VM state. * \return The number of elements pushed on stack. + * \luastack + * \lfield font The default font. + * \lfield conffile The configuration file which has been loaded. */ static int luaA_awesome_index(lua_State *L) @@ -767,6 +757,9 @@ luaA_awesome_index(lua_State *L) g_free(font); } break; + case A_TK_CONFFILE: + lua_pushstring(L, globalconf.conffile); + break; default: return 0; } @@ -831,7 +824,6 @@ luaA_init(void) { "font_set", luaA_font_set }, { "colors_set", luaA_colors_set }, { "colors", luaA_colors }, - { "conffile", luaA_conffile }, { "__index", luaA_awesome_index }, { "__newindex", luaA_awesome_newindex }, /* deprecated */