Hi, This was discussed sometime back on the users list: http://comments.gmane.org/gmane.comp.window-managers.awesome/7290. I wonder if it would be of general interest.
diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index 2d5ec45..e0d6ded 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -38,6 +38,7 @@ swap = {} floating = {} dockable = {} property = {} +marked = {} --- Get the first client that got the urgent hint. -- @return The first urgent client. @@ -554,6 +555,23 @@ function getmarked() return t end +do + -- iteration state + local i = 0 + + --- + -- Cycle through marked clients. + function marked.cycle() + i = i + 1 + + local clients = data.marked + local c = clients[util.cycle(#clients, i)] + + tag.viewonly(c:tags()[1]) + capi.client.focus = c + end +end + -- Anurag Priyam
From 3cf63102f9d74e72c1e621045234dfb92378d952 Mon Sep 17 00:00:00 2001 From: Anurag Priyam <anurag08pri...@gmail.com> Date: Sun, 5 Feb 2012 17:59:25 +0530 Subject: [PATCH] awful.client: add helper method to cycle through marked clients Signed-off-by: Anurag Priyam <anurag08pri...@gmail.com> --- lib/awful/client.lua.in | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index 2d5ec45..e0d6ded 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -38,6 +38,7 @@ swap = {} floating = {} dockable = {} property = {} +marked = {} --- Get the first client that got the urgent hint. -- @return The first urgent client. @@ -554,6 +555,23 @@ function getmarked() return t end +do + -- iteration state + local i = 0 + + --- + -- Cycle through marked clients. + function marked.cycle() + i = i + 1 + + local clients = data.marked + local c = clients[util.cycle(#clients, i)] + + tag.viewonly(c:tags()[1]) + capi.client.focus = c + end +end + --- Set a client floating state, overriding auto-detection. -- Floating client are not handled by tiling layouts. -- @param c A client. -- 1.7.9