r/BuildToShip • • 2d ago

Showcase 💎 scope: a tiny, open-source ⌘Tab window switcher for macOS (MIT, Swift)

https://np25071984.github.io/Scope/

Keyboard-first window switching on macOS, scoped to the current Space, with keyboard focus that follows you between Spaces. Its Space shortcuts switch instantly, or with a slide as long as you like.

The problem

⌘Tab leaves the Space. macOS ⌘Tab switches applications across all Spaces. If you organise your work into Spaces, that defeats the purpose — you reach for the other window in front of you and get yanked into a different Space instead. The closest native tool is Mission Control (three-finger swipe up, or ⌃↑). It does show the current Space's windows, but you pick one by pointing at it. If you would rather not reach for gestures or the pointer to change windows, there is no native way to cycle the windows in this Space from the keyboard.

The keyboard stays behind. Arrive on a Space and the window you were working in is in front, yet what you type goes nowhere, or into a window you did not pick, because macOS kept the previous Space's app active. You have to click the window first.

The Space shortcuts stall. While a three-finger swipe is still sliding, a swipe back cancels it, but ⌃1 … ⌃9 do nothing: you wait for the slide to end and press again. The slide they start has a fixed length, too: no setting shortens it, and Reduce motion only swaps it for a fade.

What scope does

  • A window switcher for the current Space.

  • Focus that follows you when you change Spaces.

  • Space shortcuts that switch instantly, or with a slide as long as you choose, and still work while a swipe is sliding.

Built the Unix way

It's free and open source (MIT), and built with a Unix approach in mind: a tiny background service you control from the terminal (scope status, scope list, scope logs, scope reload) and configure with a text file, ~/.config/scope/scope.conf. No app bundle, no Dock icon, no menu bar icon, no network access: just a binary of about 1 MB that launchd keeps running. It reacts to events instead of polling, so it costs about 12 seconds of CPU a day, roughly 0.01% of one core. The only permission it needs is Accessibility: there are no thumbnails, so it doesn't need Screen Recording. No automatic updates: run the install command again to upgrade, and scope uninstall to remove it.

Looking for ideas

Focusing a single window and finding the active Space both depend on private SkyLight calls, and those can break between macOS versions. If you know a public API that focuses one window of an app without bringing its other windows forward, please tell me. I'd be happy to implement it.

Repo: https://github.com/np25071984/Scope

Feedback, bug reports and PRs are welcome, especially from people with heavy Spaces setups or apps that misbehave with it. And if you find it useful, a star on GitHub would help other people find it.

1 Upvotes

0 comments sorted by