From 5049fe3f295a2679a6aaf5182f3ef81ec4a5af65 Mon Sep 17 00:00:00 2001 From: BZ Date: Fri, 5 Mar 2021 12:14:55 +0100 Subject: [PATCH] add integration/signal section --- README.md | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6cc2579..5bd0d0a 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,31 @@ color_marked_normal = "#ffff00", color_marked_hover = "#ff0000", ``` -Example Configuration (as shown on gif): +Integration / Signals: +------------ +It is possible to use `smart_borders` features in other modules by emitting signals. + +E.g. you might want add the rightclick menu to your tasklist: + +``` + -- @TASKLIST_BUTTON@ + -- Create a tasklist widget + s.mytasklist = awful.widget.tasklist { + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + buttons = { + awful.button({ }, 1, function(c) + c:activate { context = "tasklist", action = "toggle_minimization" } + end), + awful.button({ }, 3, function(c) + c:emit_signal("smart_borders::right_click") + end), + } + } +``` + + +Example Configuration (as shown on top gif): ------------ ``` require("smart_borders"){ @@ -240,16 +264,14 @@ require("smart_borders"){ stops = { { 0, "#a1bfcf" }, { 1, "#F7C6FF" } } }, + snapping = true, + snapping_center_mouse = true, + -- custom control example: button_back = function(c) -- set client as master c:swap(awful.client.getmaster()) end - - -- add rightclick menu to your tasklist - -- awful.button({}, 3, function(c) - -- c:emit_signal("smart_borders::right_click") - -- end) } ```