dotfiles/awesome/bindings/mouse/client.lua

36 lines
991 B
Lua
Raw Normal View History

2023-05-23 05:12:23 +00:00
--- awesome stdlib
2023-04-20 04:08:44 +00:00
local gears = require("gears")
local awful = require("awful")
local _M = {}
2023-05-23 05:35:51 +00:00
------------------------------------------
2023-04-20 04:08:44 +00:00
function _M.get()
2023-05-23 05:12:23 +00:00
local client_buttons = gears.table.join(
2023-05-26 02:15:43 +00:00
--- focus client [client::click]
awful.button({ }, 1,
function(c)
c:emit_signal("request::activate", "mouse_click",
{raise = true})
2023-05-23 05:12:23 +00:00
end),
2023-05-26 02:15:43 +00:00
--- move client [client::mod+click]
awful.button({ modkey }, 1,
function(c)
c:emit_signal("request::activate", "mouse_click",
{raise = true})
2023-04-20 04:08:44 +00:00
awful.mouse.client.move(c)
2023-05-23 05:12:23 +00:00
end),
2023-05-26 02:15:43 +00:00
--- resize client [client::mod+click_r]
awful.button({ modkey }, 3,
function(c)
c:emit_signal("request::activate", "mouse_click",
{raise = true})
2023-04-20 04:08:44 +00:00
awful.mouse.client.resize(c)
2023-05-26 02:15:43 +00:00
end)
)
2023-05-23 05:12:23 +00:00
return client_buttons
2023-04-20 04:08:44 +00:00
end
2023-05-23 05:35:51 +00:00
------------------------------------------
2023-05-26 02:15:43 +00:00
return setmetatable({}, {
__call = function(_, ...)
return _M.get(...)
end })