feat: isolate awesomeWM config

This commit is contained in:
tux
2025-02-27 16:12:22 +05:30
parent e1553de0ad
commit 5f70161a19
376 changed files with 18 additions and 7933 deletions

View 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
View 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)

View 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)