What It Does
ActiveSpace displays your current Mission Control space number as a numbered bubble in the menu bar. The icon updates instantly when you switch spaces via Mission Control, trackpad gestures, or keyboard shortcuts.
Clicking the icon gives you quick access to switch spaces — no need to invoke Mission Control or remember keyboard shortcuts.
How It Works
With two spaces, a single click is all it takes to flip between them. With three or more, a popover appears with numbered buttons — click any to jump directly to that space.
Architecture
| File | Purpose |
|---|---|
ActiveSpaceApp.swift | Entry point; wires AppDelegate |
AppDelegate.swift | Owns the NSStatusItem, routes clicks, manages the popover |
SpaceObserver.swift | Tracks current space index and total space count |
SpaceSwitcher.swift | Executes space switches via AppleScript keyboard simulation |
MenuBarIcon.swift | Renders the numbered bubble icon dynamically |
SpaceSelectorView.swift | SwiftUI popover with numbered space buttons |
CGSPrivate.swift | Swift bindings for private CoreGraphics space APIs |
Space Detection
ActiveSpace queries the private CoreGraphics CGSCopyManagedDisplaySpaces API to enumerate all spaces across all displays and identify which is current. It stays up to date via three mechanisms:
- Space change notification — fires on every space switch
- Screen parameters notification — fires when spaces are added or removed via Mission Control
- 2-second poll timer — backstop for edge cases where notifications don't fire
Installation
- Download ActiveSpace.zip from the link above
- Unzip and double-click
ActiveSpace.appto launch
To start at login, add it to System Settings → General → Login Items.
Permissions
Accessibility permission is required for AppleScript key simulation (used to switch spaces). macOS will prompt on first space switch attempt. Grant it in System Settings → Privacy & Security → Accessibility.
Building from Source
Open the Xcode project and build:
- Clone the repo:
git clone https://github.com/PerpetualBeta/ActiveSpace.git - Open
ActiveSpace.xcodeprojin Xcode - Build with Cmd+B or run with Cmd+R
Requirements
macOS 13 (Ventura) or later.