doc(tag): Add example for request::default_layouts

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
This commit is contained in:
Lucas Schwiderski 2021-06-16 22:59:01 +02:00
parent a6864a3e59
commit 1cd89e7de5
No known key found for this signature in database
GPG Key ID: AA12679AAA6DF4D8
1 changed files with 30 additions and 3 deletions

View File

@ -214,11 +214,38 @@ lua_class_t tag_class;
*/
/**
* This signal is emitted to fill the list of default layouts.
* This signal is emitted to request the list of default layouts.
*
* It is emitted on the global `tag` class rather than individual tag objects.
* The default handler is part of `rc.lua`. New modules can also use this signal
* to dynamically add new layouts to the list of default layouts.
* This default handler is part of `rc.lua`:
*
* tag.connect_signal("request::default_layouts", function()
* awful.layout.append_default_layouts({
* awful.layout.suit.floating,
* awful.layout.suit.tile,
* awful.layout.suit.tile.left,
* awful.layout.suit.tile.bottom,
* awful.layout.suit.tile.top,
* awful.layout.suit.fair,
* awful.layout.suit.fair.horizontal,
* awful.layout.suit.spiral,
* awful.layout.suit.spiral.dwindle,
* awful.layout.suit.max,
* awful.layout.suit.max.fullscreen,
* awful.layout.suit.magnifier,
* awful.layout.suit.corner.nw,
* })
* end)
*
* External modules can also use this signal to dynamically add additional
* default layouts.
*
* tag.connect_signal("request::default_layouts", function()
* awful.layout.append_default_layouts({
* custom_module.layout_1,
* custom_module.layout_2,
* })
* end)
*
* @signal request::default_layouts
* @tparam string context The context (currently always "startup").