From 06f05ac74098464d8987375b0784500a2317ac11 Mon Sep 17 00:00:00 2001 From: Luca CPZ Date: Tue, 26 Nov 2019 15:44:48 +0000 Subject: [PATCH] modkey-tab optional cycle between instead of two-history-swapping; closes #274 --- rc.lua.template | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rc.lua.template b/rc.lua.template index fe1189d..2bfad7d 100644 --- a/rc.lua.template +++ b/rc.lua.template @@ -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 ()