Name a window, press ⌘⇧ + its digit, and it's in front of you — in milliseconds. A resident macOS tool in ~100 lines of Swift you can read before you run.
One file. No dependencies. No network. MIT licensed.
In real life: ⌘ ⇧ + digit, from anywhere in macOS
How it works
Right-click the tab strip in any Chromium browser and pick Name window…. Call them 1, 2, 3 — one per project, mood, or mess.
WindowFocus sits resident, listening for the hotkey. No app launch, no script runner spinning up — that's why it responds in milliseconds, not seconds.
It asks macOS's Accessibility API for the browser's windows, finds your digit, and raises it. The same primitive every window manager uses — and nothing else.
Why trust it
Window tools need the Accessibility permission — the broad one. Most people grant it to a large app and hope for the best. WindowFocus takes the other path: make the trusted code so small you can audit every line over coffee.
One source file, ~100 lines. You compile it yourself with Apple's toolchain. No binary downloads.
Zero dependencies. Only Apple frameworks: Cocoa and Carbon. Nothing fetched, nothing bundled.
No network, no config files, no logging. There is no code path that touches the disk or the internet.
MIT licensed. Fork it, strip it, rebind it.
// the entire matching logic: func titleMatches(_ title: String, digit: String) -> Bool { guard title.hasPrefix(digit) else { return false } if title.count == digit.count { return true } let next = title[title.index( title.startIndex, offsetBy: digit.count)] return !next.isNumber } // and the entire "focus" action: AXUIElementPerformAction(window, kAXRaiseAction as CFString) app.activate()
Install
Needs only Apple's command line tools (xcode-select --install). The full walkthrough, including wrapping it in an .app so your terminal never needs permissions, is in each README. Two flavors, same ~100 lines:
# generic: set targetBundleID to your browser, then build git clone https://github.com/Neilos-Thumm/WindowFocus && cd WindowFocus swiftc windowfocus.swift -o windowfocus -framework Cocoa -framework Carbon # then follow README steps 3–6: bundle, grant, login item
# Brave users: zero configuration, just build git clone https://github.com/Neilos-Thumm/BraveFocus && cd BraveFocus swiftc bravefocus.swift -o bravefocus -framework Cocoa -framework Carbon # then follow README steps 3–6: bundle, grant, login item
Honest note: like every window tool, it needs the Accessibility permission — granted to the app you just compiled, and nothing else. The README explains exactly why, and what the permission can do.
Compatibility
| Browser | Status | |
|---|---|---|
| Brave | verified | Developed and daily-driven here (macOS 14) |
| Chrome, Chromium | expected | Window naming is upstream Chromium code — same code path |
| Edge, Vivaldi, Opera | expected | Same upstream feature; unverified forks |
| Safari, Firefox | n/a | No window-naming feature — nothing to match against |
Point it at any other app by changing one line (targetBundleID) — it works on anything whose window titles you control, like terminals. Verified your browser? Open an issue and it moves up the table.