mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-07 05:26:34 +05:30
feat: isolate awesomeWM config
This commit is contained in:
5
src/binds/client/init.lua
Normal file
5
src/binds/client/init.lua
Normal file
@ -0,0 +1,5 @@
|
||||
-- Returns all client mouse and keybinds.
|
||||
return {
|
||||
keys = require(... .. ".keys"),
|
||||
mouse = require(... .. ".mouse"),
|
||||
}
|
24
src/binds/client/keys.lua
Normal file
24
src/binds/client/keys.lua
Normal file
@ -0,0 +1,24 @@
|
||||
local awful = require("awful")
|
||||
|
||||
local mod = require("binds.mod")
|
||||
local modkey = mod.modkey
|
||||
|
||||
--- Client keybindings.
|
||||
client.connect_signal("request::default_keybindings", function()
|
||||
awful.keyboard.append_client_keybindings({
|
||||
-- Client state management.
|
||||
awful.key({ modkey }, "f", function(c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end, { description = "toggle fullscreen", group = "client" }),
|
||||
awful.key({ modkey }, "q", function(c)
|
||||
c:kill()
|
||||
end, { description = "close", group = "client" }),
|
||||
awful.key({ modkey, mod.shift }, "q", function(c)
|
||||
if c.pid then
|
||||
awful.spawn("kill -9 " .. c.pid)
|
||||
end
|
||||
end, { description = "force close", group = "client" }),
|
||||
awful.key({ modkey }, "space", awful.client.floating.toggle, { description = "toggle floating", group = "client" }),
|
||||
})
|
||||
end)
|
19
src/binds/client/mouse.lua
Normal file
19
src/binds/client/mouse.lua
Normal file
@ -0,0 +1,19 @@
|
||||
local awful = require("awful")
|
||||
|
||||
local mod = require("binds.mod")
|
||||
local modkey = mod.modkey
|
||||
|
||||
--- Client mouse bindings.
|
||||
client.connect_signal("request::default_mousebindings", function()
|
||||
awful.mouse.append_client_mousebindings({
|
||||
awful.button(nil, 1, function(c)
|
||||
c:activate({ context = "mouse_click" })
|
||||
end),
|
||||
awful.button({ modkey }, 1, function(c)
|
||||
c:activate({ context = "mouse_click", action = "mouse_move" })
|
||||
end),
|
||||
awful.button({ modkey }, 3, function(c)
|
||||
c:activate({ context = "mouse_click", action = "mouse_resize" })
|
||||
end),
|
||||
})
|
||||
end)
|
Reference in New Issue
Block a user