awesome: better toggle maximize, add keys to focus nth window on active tag
This commit is contained in:
@@ -236,6 +236,15 @@ local function layout_menu()
|
||||
awful.menu(layouts):show()
|
||||
end
|
||||
|
||||
local function focus_nth_window (n)
|
||||
local cc = {}
|
||||
for _, c in ipairs(client.get()) do
|
||||
if awful.widget.tasklist.filter.currenttags(c, mouse.screen) then cc[#cc + 1] = c end
|
||||
end
|
||||
local new_focused = cc[n]
|
||||
if new_focused then client.focus = new_focused; new_focused:raise() end
|
||||
end
|
||||
|
||||
-- {{{ Key bindings
|
||||
local globalkeys = gears.table.join(
|
||||
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
|
||||
@@ -368,8 +377,11 @@ local clientkeys = gears.table.join(
|
||||
{ description = "minimize", group = "client" }),
|
||||
awful.key({ modkey, }, "m",
|
||||
function(c)
|
||||
c.maximized = not c.maximized
|
||||
c:raise()
|
||||
if awful.layout.getname() == "max" then
|
||||
awful.layout.set(awful.layout.suit.tile)
|
||||
else
|
||||
awful.layout.set(awful.layout.suit.max)
|
||||
end
|
||||
end,
|
||||
{ description = "(un)maximize", group = "client" }),
|
||||
awful.key({ modkey, }, "v",
|
||||
@@ -432,7 +444,11 @@ for i = 1, 9 do
|
||||
end
|
||||
end
|
||||
end,
|
||||
{ description = "toggle focused client on tag #" .. i, group = "tag" })
|
||||
{ description = "toggle focused client on tag #" .. i, group = "tag" }),
|
||||
--- Focus nth window
|
||||
awful.key({ "Control" }, "#" .. i + 9,
|
||||
function() focus_nth_window(i) end,
|
||||
{ description = "focus window index #" .. i, group = "client" })
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user