From 4d35f430dc6341ab4bb67fd7390d7f62718e1752 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 16 Mar 2014 20:09:43 +0100 Subject: [PATCH] Add awesome.startup This boolean describes if we are still in startup or if our main loop is already running. Signed-off-by: Uli Schlachter --- luaa.c | 7 +++++++ luadoc/awesome.lua | 1 + 2 files changed, 8 insertions(+) diff --git a/luaa.c b/luaa.c index 9c7b017cc..340bf4635 100644 --- a/luaa.c +++ b/luaa.c @@ -430,6 +430,7 @@ luaA_isloop(lua_State *L, int idx) * \lfield conffile The configuration file which has been loaded. * \lfield version The version of awesome. * \lfield release The release name of awesome. + * \lfield startup True if we are still in startup, false otherwise. * \lfield startup_errors Error message for errors that occured during startup. * \lfield composite_manager_running True if a composite manager is running. */ @@ -459,6 +460,12 @@ luaA_awesome_index(lua_State *L) return 1; } + if(A_STREQ(buf, "startup")) + { + lua_pushboolean(L, globalconf.loop == NULL); + return 1; + } + if(A_STREQ(buf, "startup_errors") && globalconf.startup_errors.len != 0) { lua_pushstring(L, globalconf.startup_errors.s); diff --git a/luadoc/awesome.lua b/luadoc/awesome.lua index 43037c272..f7d879c17 100644 --- a/luadoc/awesome.lua +++ b/luadoc/awesome.lua @@ -7,6 +7,7 @@ module("awesome") -- @field version The version of awesome. -- @field release The release name of awesome. -- @field conffile The configuration file which has been loaded. +-- @field startup True if we are still in startup, false otherwise. -- @field startup_errors Error message for errors that occured during startup. -- @field composite_manager_running True if a composite manager is running. -- @class table