mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-16 07:47:22 +01:00
Get keygrabber running state
Add a function keygrabber.isrunning() which return a boolean state of keygrabber Signed-off-by: Sébastien Luttringer <seblu@seblu.net> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
f9e3bc8a7a
commit
c27ce1e833
1 changed files with 14 additions and 0 deletions
14
keygrabber.c
14
keygrabber.c
|
@ -129,10 +129,24 @@ luaA_keygrabber_stop(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/** Check if keygrabber is running.
|
||||
* \param L The Lua VM state.
|
||||
* \return The number of elements pushed on stack.
|
||||
* \luastack
|
||||
* \lreturn A boolean value, true if keygrabber is running, false otherwise.
|
||||
*/
|
||||
static int
|
||||
luaA_keygrabber_isrunning(lua_State *L)
|
||||
{
|
||||
lua_pushboolean(L, globalconf.keygrabber != LUA_REFNIL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const struct luaL_reg awesome_keygrabber_lib[] =
|
||||
{
|
||||
{ "run", luaA_keygrabber_run },
|
||||
{ "stop", luaA_keygrabber_stop },
|
||||
{ "isrunning", luaA_keygrabber_isrunning },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue