awesome: Add get_* and set_xproperty

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2014-03-23 18:15:03 +01:00
parent 2869cdc860
commit a6fb932bbc
4 changed files with 35 additions and 0 deletions

2
luaa.c
View File

@ -358,6 +358,8 @@ luaA_init(xdgHandle* xdg)
{ "systray", luaA_systray },
{ "load_image", luaA_load_image },
{ "register_xproperty", luaA_register_xproperty },
{ "set_xproperty", luaA_set_xproperty },
{ "get_xproperty", luaA_get_xproperty },
{ "__index", luaA_awesome_index },
{ NULL, NULL }
};

View File

@ -44,6 +44,17 @@ module("awesome")
-- @name register_xproperty
-- @class function
--- Change a xproperty.
-- @param name The name of the X11 property
-- @param value The new value for the property
-- @name set_xproperty
-- @class function
--- Get the value of a xproperty.
-- @param name The name of the X11 property
-- @name get_xproperty
-- @class function
--- Add a global signal.
-- @param name A string with the event name.
-- @param func The function to call.

View File

@ -525,4 +525,24 @@ luaA_register_xproperty(lua_State *L)
return 0;
}
/** Set an xproperty.
* \param L The Lua VM state.
* \return The number of elements pushed on stack.
*/
int
luaA_set_xproperty(lua_State *L)
{
return window_set_xproperty(L, globalconf.screen->root, 1, 2);
}
/** Get an xproperty.
* \param L The Lua VM state.
* \return The number of elements pushed on stack.
*/
int
luaA_get_xproperty(lua_State *L)
{
return window_get_xproperty(L, globalconf.screen->root, 1);
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -47,6 +47,8 @@ PROPERTY(net_wm_icon);
void property_handle_propertynotify(xcb_property_notify_event_t *ev);
int luaA_register_xproperty(lua_State *L);
int luaA_set_xproperty(lua_State *L);
int luaA_get_xproperty(lua_State *L);
struct xproperty {
xcb_atom_t atom;