BackNav: an Alt+Tab alternative that understands tabs

Alt+Tab has switched windows since Windows 3.x, around 1990. Tabs did not exist yet — browsers would not popularise them for another decade, and it was years after that before working in a dozen tabs at once became normal.

The result is that a browser with thirty tabs open is one window. A Konsole with six sessions is one window. Work in Tab 1, then Tab 2, then Alt+Tab “back to what I was just doing”, and you land in a different application entirely.

Ctrl+Tab isn’t the answer either. It only moves within one application, so it can’t take you back to something in a different one. It isn’t universal — each app picks its own key, and plenty offer nothing. And what it does varies: some cycle by recency, some step in order, some pop up their own chooser.

So before you can press anything, you have to work out where you’re going: inside this application or outside it, one key or the other, and the wrong guess takes you somewhere unrelated.

BackNav keeps one most-recently-used trail across windows and the tabs inside them, with a single shortcut to walk back along it — whichever side of an application boundary the last thing happens to be on.

video demo

wo gestures, and they don’t overlap:

  • Tap the shortcut — step back one place. Repeat to keep going.
  • Hold it — a switcher panel appears, and nothing moves until you choose.

Tap to act, hold to look. The ordering is MRU rather than a browser-style back stack: revisiting somewhere promotes it rather than appending a duplicate.

What it can navigate

what BackNav restores
Chrome, Brave, Vivaldi, Edge, Opera, Chromium the individual tab
Firefox the individual tab
Thunderbird the individual mail or message tab
Konsole the individual tab
Kate the individual document
qpdfview the individual document
kitty the individual tab
anything else raised and focused, like Alt+Tab

Nothing needs to be on that list for BackNav to be useful — everything else still works at the window level. The list is about how deep it can go.

Why not a KWin TabBox switcher?

Because TabBox enumerates windows, and a tab is not a window. It has no entry in the compositor, no place in the stacking order, and nothing for KWin to switch to. The only thing that knows which tab is active is the application itself, so the work is in asking it — over D-Bus for Konsole, Kate and qpdfview, over its own protocol for kitty, and via a small WebExtension for browsers and Thunderbird, since those expose nothing externally at all.

That’s also why the supported list is short and specific. An application needs three things: a signal that a tab changed, a way to report which one is active, and a way to switch to a given tab without creating it. The third is where most fall down — Okular’s tab-opening call adds a second tab for a file that’s already open, so “go back to that document” would silently duplicate it. Kate is supported only because it happens to also expose a non-creating activate(token).

Installing

Requires Plasma 6 on Wayland and Python 3.

git clone https://github.com/davidmal1/backnav.git

cd backnav

./install.sh

That handles dependencies, both KWin scripts, and the daemon as a user service. It deliberately stops short of binding a shortcut — Alt+Tab collides with Walk Through Windows, and that’s your decision to make, not a script’s.

Browser tab support needs the extension from browser/; without it a browser is simply one entry rather than one per tab.

GPL-3.0. Repository: GitHub - davidmal1/backnav: An Alt+Tab alternative that understands tabs. MRU switching across your windows and the tabs inside them, for KDE Plasma on Wayland. · GitHub

Where it’s rough

Honest list, since this is early:

  • Plasma 6 Wayland only. Not tested on X11.
  • Chromium-based browsers need the extension loaded unpacked — it isn’t on the Chrome Web Store yet. Firefox’s is signed by Mozilla and installs normally.
  • Tab support keys off the exact resource class KWin reports, which varies by packaging in ways that aren’t predictable. The daemon now names the class it saw when it doesn’t recognise one, so adding a browser is a one-line change.

Feedback welcome, particularly on applications you’d want supported. There’s a procedure in the repo for testing whether an app can be — it takes about five minutes and needs no knowledge of the codebase.

1 Like

Please don’t paste LLM generated content here.

2 Likes

My apologies for those offended by the agentic assistance.

What it says is accurate. For years I have been frustrated at default alt-tab behaviour. Having a single, consistent shortcut to go ‘back’ can be a game changer, especially when going back and forth a lot.

AI has allowed me to create this utility. My intention here is solely to share it with those that may be interested and perhaps a step toward having this functionality built in.