Switching windows in i3 (or any other Xorg WM) with alt + tab

Alt + tab

People are divided in two groups : Those who use switch windows with the keyboard, and the, hum, let’s call them the others.

Until about recently, I was using a quite hacky solution (that worked, mostly) to just toggle between the two last used windows. And then the light entered the room in the form of a single command. Available in the main repos 😲

1
apt install alttab

I spent so much time ignoring the very existence of this gem because it’s so hard to search for, I don’t even remember by what kind of earthy miracle I stumbled upon it. Well, it’s there now.

Alt-tab in i3 (Xorg)Alt-tab in i3 (Xorg)

In fact, my whole config / workflow has changed since.

In i3

~/.config/i3/config
1
exec_always --no-startup-id alttab -d 1 -t 132x132 -i 128x128 -bg "#262626" -fg "#262626" -frame "#15539e"

I didn’t even have to do any key binding, this things (unless told differently of course) steals Alt+tab and-that’s-it 🙂