modkey-tab optional cycle between instead of two-history-swapping; closes #274

This commit is contained in:
Luca CPZ 2019-11-26 15:44:48 +00:00
parent 99988d7c1f
commit 06f05ac740
No known key found for this signature in database
GPG Key ID: D44FC5FFC3500D1E
1 changed files with 17 additions and 2 deletions

View File

@ -91,6 +91,7 @@ local modkey = "Mod4"
local altkey = "Mod1"
local terminal = "urxvtc"
local vi_focus = false -- vi-like client focus - https://github.com/lcpz/awesome-copycats/issues/275
local cycle_prev = true -- cycle trough all previous client or just the first -- https://github.com/lcpz/awesome-copycats/issues/274
local editor = os.getenv("EDITOR") or "vim"
local gui_editor = os.getenv("GUI_EDITOR") or "gvim"
local browser = os.getenv("BROWSER") or "firefox"
@ -334,12 +335,26 @@ globalkeys = my_table.join(
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if cycle_prev then
awful.client.focus.history.previous()
else
awful.client.focus.byidx(-1)
end
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "client"}),
{description = "cycle with previous/go back", group = "client"}),
awful.key({ modkey, "Shift" }, "Tab",
function ()
if cycle_prev then
awful.client.focus.byidx(1)
if client.focus then
client.focus:raise()
end
end
end,
{description = "go forth", group = "client"}),
-- Show/Hide Wibox
awful.key({ modkey }, "b", function ()