I am using awesomewm and have two monitors, so Mod4+j and Mod4+k cycle through windows on current screen only. Is there a way to cycle through all windows/clients on all screens to make it work like ordinary Alt+Tab?
- 181
- 1
- 7
3 Answers
After poking around awful module docs i found a solution. It is hacky, but it works as I wanted it to work.
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.byidx(1)
if awful.client.ismarked() then
awful.screen.focus_relative(-1)
awful.client.getmarked()
end
if client.focus then
client.focus:raise()
end
awful.client.togglemarked()
end),
This function cycles through clients on current screen, marking them and when they all are marked, jumps to the next screen. Here is what happens step by step:
- we focus the next client
- we check if it is marked and if it is, we move to the next screen and clear marked status from all clients on it
- we raise current client
- and mark it
It is funny because i do not know what "marked" means. Marked clients do not seem to differ from not marked clients visually or by behaviour.
It is strange that i had to write a 10 line function to get something as trivial as multiscreen alt-tab. I might have done something excessive)
- 181
- 1
- 7
I'm not sure when this capability was added, but I believe you're looking for
client.focus.global_bydirection (dir, c)
Focus a client by the given direction. Moves across screens. Parameters:
- dir: The direction, can be either "up", "down", "left" or "right".
- c: Optional client.
- 313
I am using the awesome-cyclefocus module
awesome-cyclefocus is a module/plugin for the awesome window manager, which provides methods to cycle through the most recently used clients (typically known as Alt-Tab).
It allows to easily filter the list of windows to be cycled through, e.g. by screen, tags, window class, name/title etc.
- 251
- 1
- 6