dotfiles/awesome/bindings/keys/client.lua

89 lines
2.3 KiB
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 = {}
local modkey = RC.vars.modkey
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_keys = gears.table.join(
2023-05-26 02:15:43 +00:00
awful.key({ modkey }, "f",
function(c)
2023-04-20 04:08:44 +00:00
c.fullscreen = not c.fullscreen
c:raise()
end,
2023-05-26 02:15:43 +00:00
{ description = "toggle fullscreen",
group = "client"}),
awful.key({ modkey, "Shift" }, "c",
function(c)
c:kill()
end,
{ description = "close",
group = "client" }),
awful.key({ modkey, "Control" }, "space",
awful.client.floating.toggle,
{ description = "toggle floating",
group = "client" }),
awful.key({ modkey, "Control" }, "Return",
function(c)
c:swap(awful.client.getmaster())
end,
{ description = "move to master",
group = "client" }),
awful.key({ modkey }, "o",
function(c)
c:move_to_screen()
end,
{ description = "move to screen",
group = "client" }),
awful.key({ modkey }, "t",
function(c)
c.ontop = not c.ontop
end,
{ description = "toggle keep on top",
group = "client" }),
awful.key({ modkey }, "n",
function(c)
2023-04-20 04:08:44 +00:00
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
2023-05-26 02:15:43 +00:00
end,
{ description = "minimize",
group = "client"}),
2023-04-20 04:08:44 +00:00
awful.key({ modkey, }, "m",
2023-05-26 02:15:43 +00:00
function(c)
2023-04-20 04:08:44 +00:00
c.maximized = not c.maximized
c:raise()
2023-05-26 02:15:43 +00:00
end,
{ description = "(un)maximize",
group = "client" }),
2023-04-20 04:08:44 +00:00
awful.key({ modkey, "Control" }, "m",
2023-05-26 02:15:43 +00:00
function(c)
2023-04-20 04:08:44 +00:00
c.maximized_vertical = not c.maximized_vertical
c:raise()
2023-05-26 02:15:43 +00:00
end,
{ description = "(un)maximize vertically",
group = "client" }),
2023-04-20 04:08:44 +00:00
awful.key({ modkey, "Shift" }, "m",
2023-05-26 02:15:43 +00:00
function(c)
2023-04-20 04:08:44 +00:00
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
2023-05-26 02:15:43 +00:00
end,
{ description = "(un)maximize horizontally",
group = "client" })
2023-04-20 04:08:44 +00:00
)
2023-05-23 05:12:23 +00:00
return client_keys
2023-04-20 04:08:44 +00:00
end
2023-05-23 05:35:51 +00:00
------------------------------------------
2023-04-20 04:08:44 +00:00
return setmetatable({}, { __call = function(_, ...) return _M.get(...) end })