Browse Source

awesome: Add get_* and set_xproperty

Signed-off-by: Uli Schlachter <psychon@znc.in>
Uli Schlachter 5 years ago
parent
commit
a6fb932bbc
4 changed files with 35 additions and 0 deletions
  1. 2
    0
      luaa.c
  2. 11
    0
      luadoc/awesome.lua
  3. 20
    0
      property.c
  4. 2
    0
      property.h

+ 2
- 0
luaa.c View File

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

+ 11
- 0
luadoc/awesome.lua View File

@@ -44,6 +44,17 @@ module("awesome")
44 44
 -- @name register_xproperty
45 45
 -- @class function
46 46
 
47
+--- Change a xproperty.
48
+-- @param name The name of the X11 property
49
+-- @param value The new value for the property
50
+-- @name set_xproperty
51
+-- @class function
52
+
53
+--- Get the value of a xproperty.
54
+-- @param name The name of the X11 property
55
+-- @name get_xproperty
56
+-- @class function
57
+
47 58
 --- Add a global signal.
48 59
 -- @param name A string with the event name.
49 60
 -- @param func The function to call.

+ 20
- 0
property.c View File

@@ -525,4 +525,24 @@ luaA_register_xproperty(lua_State *L)
525 525
     return 0;
526 526
 }
527 527
 
528
+/** Set an xproperty.
529
+ * \param L The Lua VM state.
530
+ * \return The number of elements pushed on stack.
531
+ */
532
+int
533
+luaA_set_xproperty(lua_State *L)
534
+{
535
+    return window_set_xproperty(L, globalconf.screen->root, 1, 2);
536
+}
537
+
538
+/** Get an xproperty.
539
+ * \param L The Lua VM state.
540
+ * \return The number of elements pushed on stack.
541
+ */
542
+int
543
+luaA_get_xproperty(lua_State *L)
544
+{
545
+    return window_get_xproperty(L, globalconf.screen->root, 1);
546
+}
547
+
528 548
 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

+ 2
- 0
property.h View File

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

Loading…
Cancel
Save