diff --git a/luaa.c b/luaa.c index f42df0ce9..01b08d2fc 100644 --- a/luaa.c +++ b/luaa.c @@ -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 } }; diff --git a/luadoc/awesome.lua b/luadoc/awesome.lua index f7d879c17..ec6c61d64 100644 --- a/luadoc/awesome.lua +++ b/luadoc/awesome.lua @@ -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. diff --git a/property.c b/property.c index 59a979887..0f5bbb0d1 100644 --- a/property.c +++ b/property.c @@ -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 diff --git a/property.h b/property.h index 59277f874..ded1b75a9 100644 --- a/property.h +++ b/property.h @@ -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;