awful: add maximize function
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
f16cedc650
commit
4a47502e16
|
@ -195,6 +195,7 @@ keybinding({ modkey, "Control" }, "r", awesome.restart):add()
|
||||||
keybinding({ modkey, "Shift" }, "q", awesome.quit):add()
|
keybinding({ modkey, "Shift" }, "q", awesome.quit):add()
|
||||||
|
|
||||||
-- Client manipulation
|
-- Client manipulation
|
||||||
|
keybinding({ modkey }, "m", awful.client.maximize):add()
|
||||||
keybinding({ modkey, "Shift" }, "c", function () client.focus_get():kill() end):add()
|
keybinding({ modkey, "Shift" }, "c", function () client.focus_get():kill() end):add()
|
||||||
keybinding({ modkey }, "j", function () awful.client.focus(1); client.focus_get():raise() end):add()
|
keybinding({ modkey }, "j", function () awful.client.focus(1); client.focus_get():raise() end):add()
|
||||||
keybinding({ modkey }, "k", function () awful.client.focus(-1); client.focus_get():raise() end):add()
|
keybinding({ modkey }, "k", function () awful.client.focus(-1); client.focus_get():raise() end):add()
|
||||||
|
|
|
@ -145,6 +145,19 @@ function P.client.moveresize(x, y, w, h, c)
|
||||||
sel.coords = coords
|
sel.coords = coords
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Maximize a client to use the full workspace area.
|
||||||
|
-- @param c A client, or the focused one if nil.
|
||||||
|
function P.client.maximize(c)
|
||||||
|
local sel = c or client.focus_get()
|
||||||
|
if sel then
|
||||||
|
sel.floating = true
|
||||||
|
local ws = screen.workspace_get(sel.screen)
|
||||||
|
ws.width = ws.width - 2 * sel.border_width
|
||||||
|
ws.height = ws.height - 2 * sel.border_width
|
||||||
|
sel.coords = ws
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- Give the focus to a screen, and move pointer.
|
--- Give the focus to a screen, and move pointer.
|
||||||
-- @param Screen number.
|
-- @param Screen number.
|
||||||
function P.screen.focus(i)
|
function P.screen.focus(i)
|
||||||
|
|
Loading…
Reference in New Issue