diff --git a/README.md b/README.md index 584c9fd..6cc2579 100644 --- a/README.md +++ b/README.md @@ -34,16 +34,16 @@ If you end up using this module, consider removing default titlebar initializati Controls: ------------ -| button | default action | handler | -|---|---|---| -| left click | move client | `button_left_click` -| right click | open client menu | `button_right_click` -| double left click | toggle maximize | `button_double_click` -| middle click | resize client | `button_middle_click` -| mousewheel up | increase client height | `button_wheel_up` -| mousewheel down | decrease client height | `button_wheel_down` -| mouse forward | swap client with next client by index | `button_forward` -| mouse back | swap client with previous client by index | `button_back` +| button | default action | handler | signal | +|---|---|---|---| +| left click | move client | `button_left_click` | `smart_borders::left_click` +| right click | open client menu | `button_right_click`| `smart_borders::right_click` +| double left click | toggle maximize | `button_double_click` | `smart_borders::left_click` +| middle click | resize client | `button_middle_click` | `smart_borders::middle_click` +| mousewheel up | increase client height | `button_wheel_up` | `smart_borders::wheel_up` +| mousewheel down | decrease client height | `button_wheel_down` | `smart_borders::wheel_down` +| mouse forward | swap client with next client by index | `button_forward` | `smart_borders::forward_click` +| mouse back | swap client with previous client by index | `button_back` | `smart_borders::back_click` Customization: ------------ @@ -245,6 +245,11 @@ require("smart_borders"){ -- 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) } ``` diff --git a/init.lua b/init.lua index a4082e0..e94fbed 100644 --- a/init.lua +++ b/init.lua @@ -326,25 +326,35 @@ local function new(config) end end - button_funcs[1] = left_click_function + client.connect_signal("smart_borders::left_click", left_click_function) + client.connect_signal("smart_borders::middle_click", button_middle_click) + client.connect_signal("smart_borders::right_click", button_right_click) + client.connect_signal("smart_borders::wheel_up", button_wheel_up) + client.connect_signal("smart_borders::wheel_down", button_wheel_down) + client.connect_signal("smart_borders::back_click", button_back) + client.connect_signal("smart_borders::forward_click", button_forward) + + button_funcs[1] = function(c) + c:emit_signal("smart_borders::left_click") + end button_funcs[2] = function(c) - button_middle_click(c) + c:emit_signal("smart_borders::middle_click") end button_funcs[3] = function(c) - button_right_click(c) + c:emit_signal("smart_borders::right_click") end button_funcs[4] = function(c) - button_wheel_up(c) + c:emit_signal("smart_borders::wheel_up") end button_funcs[5] = function(c) - button_wheel_down(c) + c:emit_signal("smart_borders::wheel_down") end button_funcs[8] = function(c) - button_back(c) + c:emit_signal("smart_borders::back_click") end button_funcs[9] = function(c) - button_forward(c) + c:emit_signal("smart_borders::forward_click") end local function handle_button_press(c, button) local func = button_funcs[button]