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

Left-click ├── 1 space → no-op ├── 2 spaces → toggles between them └── 3+ spaces → opens popover with numbered buttons Right-click → Quit

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

FilePurpose
ActiveSpaceApp.swiftEntry point; wires AppDelegate
AppDelegate.swiftOwns the NSStatusItem, routes clicks, manages the popover
SpaceObserver.swiftTracks current space index and total space count
SpaceSwitcher.swiftExecutes space switches via AppleScript keyboard simulation
MenuBarIcon.swiftRenders the numbered bubble icon dynamically
SpaceSelectorView.swiftSwiftUI popover with numbered space buttons
CGSPrivate.swiftSwift 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:

  1. Space change notification — fires on every space switch
  2. Screen parameters notification — fires when spaces are added or removed via Mission Control
  3. 2-second poll timer — backstop for edge cases where notifications don't fire

Installation

  1. Download ActiveSpace.zip from the link above
  2. Unzip and double-click ActiveSpace.app to 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:

  1. Clone the repo: git clone https://github.com/PerpetualBeta/ActiveSpace.git
  2. Open ActiveSpace.xcodeproj in Xcode
  3. Build with Cmd+B or run with Cmd+R

Requirements

macOS 13 (Ventura) or later.