I've just installed awesome as my wm. When I do alt+tab using awesome, it just switch two apps, it's not possible to get active the others..any idea?
-
hold alt while pushing tab multiple times. – Daniel Jul 28 '12 at 00:07
-
@Daniel thanks, but it only switches between two apps – tirenweb Jul 28 '12 at 00:15
7 Answers
By default, the client sets focus to the previous window that had focus. When you alt+tab and it changes windows, the previous window is now the original window. Hence, it cycles between two windows.
To fix this, you will need to change the following:
In the default rc.lua, the section that controls window cycling looks like this:
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end),
To cycle through all the windows, and not just the previous, change the above code to the following:
awful.key({ modkey, }, "Tab",
function ()
-- awful.client.focus.history.previous()
awful.client.focus.byidx(-1)
if client.focus then
client.focus:raise()
end
end),
awful.key({ modkey, "Shift" }, "Tab",
function ()
-- awful.client.focus.history.previous()
awful.client.focus.byidx(1)
if client.focus then
client.focus:raise()
end
end),
That will cycle through the windows when you press Alt+Tab
, and in reverse order when you press Alt+Shift+Tab
. (The two lines beginning with --
are comments, so they do not affect the outcome.)
To cycle through every client on a tag, even minimized ones, you may find this function helpful:
awful.key({ modkey, }, "Tab",
function ()
for c in awful.client.iterate(function (x) return true end) do
client.focus = c
client.focus:raise()
end
end),
Note that none of these solutions consider the history whatsoever, and instead will switch to the window that had focus least recently (i.e., does not consider the ordering in which windows had focus).

- 741
- 5
- 9
-
3This most certainly *does* work. You may need to restart awesome or run kill -s SIGHUP $(which awesome) to get it to take effect. – Sep 12 '12 at 15:13
-
I have just begun to use awesome. Very useful your configuration tip, thanks! – Ciges Jan 16 '14 at 16:58
-
4The first solution is just the same as the default for `modkey+j` and `modkey+k`. – blueyed Feb 28 '14 at 22:26
I have created a module for this: https://github.com/blueyed/awesome-cyclefocus
It supports different methods of Alt-Tab
(see the README) and can be easily configured to your liking via filters that get applied while cycling through the windows, e.g. to filter only windows with the same WM class, or on the same screen/tag.

- 27,102
- 4
- 75
- 71
-
@ChristopherCorley Great. I have a lot of local, uncommitted modification which are cooking up, e.g. using on-top during cycling and having callbacks to set opacity on non-current windows. Let me know in the Github issues if you're missing something etc. – blueyed May 13 '15 at 15:37
-
Fantastic! IMO the default Alt-Tab in awesomewm is not very good, and this module fixes it :) – drgibbon Sep 29 '16 at 15:47
I've done something similar with my setup that Chris provided in his solution. Rather than shifing focus through all the windows, however, it actually cycles them through the master and slave stack. In other words, they all visibly rotate on screen:
awful.key({ modkey, "Shift" }, "Tab",
function ()
awful.client.cycle(false)
awful.client.focus.byidx(0,awful.client.getmaster()) -- Added 2013-03-01
end),
awful.key({ modkey, }, "Tab",
function ()
awful.client.cycle(true)
awful.client.focus.byidx(0,awful.client.getmaster()) -- Added 2013-03-01
end),
I still need to tweak that a bit, since I'd like focus to (at least appear to) remain on the master window throughout the cycle operation. I'm still familiarizing myself with the Awesome Lua API when I found aweful.client.cycle that makes it so easy. :)
I figured I would just chime in with this current solution of mine since this is among the first resources I investigated that addressed my similar question. Hope it helps.

- 133
- 1
- 6
In the default binds Mod + Tab cycles between the last two used applications. I was looking for Mod + j or Mod + k (reverse order).

- 30,963
- 73
- 183
- 303
-
2What's nice about Alt + Tab in most window managers is that it cycles through windows in the order when they were most recently focused. Mod + j in Awesome, on the other hand, cycles through the windows in a pre-determined order, which is not nearly as useful to me. – Jim Garrison Sep 09 '12 at 08:31
-
2@JimGarrison See my answer. I have created a module for this: https://github.com/blueyed/awesome-cyclefocus – blueyed Mar 05 '14 at 17:29
There is library for awesome called awesome-switcher-preview. This implements a alt-tab behavior similar to what you would expect on other operating systems and window managers. It cycles through windows in the order when they were most recently focused. It cycles through all clients in your selected tag set for a screen. It includes minimized clients. It attempts to not mess up the history until a selection is made. It does not alter the stack much. Holding alt down keeps the preview/alt-tab switcher up.
You can get it here: https://github.com/berlam/awesome-switcher-preview

- 6,455
- 3
- 32
- 42
Another option is using standalone 3rd party application: https://github.com/sagb/alttab

- 160
- 8
I must say it took me some time to set a proper configuration in order to get the behavior I was looking for: cycling through ALL windows, including (especially!) minimized ones, on ALL tags, without raising or focusing them and with a preview or a notice.
- Editing the awesome config (given above) : will only cycle through unminimized windows.
- awesome_alttab deprecated
- awesome-switcher for awesome 3.5
- cycle-focus : At last! I got it working only after commenting out line 102, but not by overriding with an empty
cycle_filters
in rc.lua
awesome-cyclefocus/init.lua :
cycle_filters = {
--function(c, source_c) return not c.minimized end, --luacheck: no unused args
},
rc.lua
cyclefocus.key({ "Mod1", }, "Tab", {
show_clients = false,
focus_clients = false,
}),

- 1,651
- 1
- 19
- 29