Add FROM_KIWMIC
This commit is contained in:
parent
bc19aa6817
commit
25cf3d50c4
3 changed files with 20 additions and 0 deletions
|
@ -27,15 +27,25 @@ ipc_eval(
|
|||
|
||||
int top = lua_gettop(L);
|
||||
|
||||
lua_pushboolean(L, true);
|
||||
lua_setglobal(L, "FROM_KIWMIC");
|
||||
|
||||
if (luaL_dostring(L, message)) {
|
||||
const char *error = lua_tostring(L, -1);
|
||||
wlr_log(WLR_ERROR, "Error running IPC command: %s", error);
|
||||
kiwmi_command_send_done(
|
||||
command_resource, KIWMI_COMMAND_ERROR_FAILURE, error);
|
||||
lua_pop(L, 1);
|
||||
|
||||
lua_pushboolean(L, false);
|
||||
lua_setglobal(L, "FROM_KIWMIC");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
lua_pushboolean(L, false);
|
||||
lua_setglobal(L, "FROM_KIWMIC");
|
||||
|
||||
int results = top - lua_gettop(L);
|
||||
|
||||
if (results == 0) {
|
||||
|
|
|
@ -224,6 +224,10 @@ luaK_create(struct kiwmi_server *server)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// create FROM_KIWMIC global
|
||||
lua_pushboolean(L, false);
|
||||
lua_setglobal(L, "FROM_KIWMIC");
|
||||
|
||||
// create kiwmi global
|
||||
lua_pushcfunction(L, luaK_kiwmi_server_new);
|
||||
lua_pushlightuserdata(L, lua);
|
||||
|
|
|
@ -6,6 +6,12 @@ This means Lua's garbage collection has no effect on the lifetime of the object.
|
|||
|
||||
kiwmi offers the following classes to work with:
|
||||
|
||||
## Globals
|
||||
|
||||
### `FROM_KIWMIC`
|
||||
|
||||
`true` when invoked from kiwmic, `false` otherwise.
|
||||
|
||||
## kiwmi_server
|
||||
|
||||
This is the type of the global `kiwmi` singleton, representing the compositor.
|
||||
|
|
Loading…
Reference in a new issue