Skip to content

Repository files navigation

BackPlace

BackPlace is a native macOS menu bar utility written in Swift and SwiftUI. It captures window layouts and restores them after monitor reconnects, sleep/wake cycles, or manual workspace switching.

Features

  • MenuBarExtra app with save, restore, layouts, and settings actions
  • Accessibility permission onboarding
  • First-run welcome window and reusable tutorial/help window
  • Local JSON layout storage with named layouts
  • Display change and wake detection
  • Window capture and restore via Accessibility APIs
  • Quartz-based window discovery to improve matching
  • Named layout management and ignored apps settings
  • GitHub release update checks with in-app download flow
  • Ko-fi support button and support/feedback settings area
  • Feedback composer with GitHub issue submission support
  • Optional app relaunch during restore retries
  • Debug-friendly diagnostics through os.Logger

Architecture

  • PermissionsService
  • ScreenWatcher
  • WorkspaceWatcher
  • WindowDiscoveryService
  • LayoutStore
  • RestoreEngine
  • UpdateService
  • FeedbackService

Build

This repository is structured as a Swift package that can be opened directly in Xcode.

Command-line build in this environment uses the full Xcode toolchain explicitly:

HOME=/tmp/backplace-home \
CLANG_MODULE_CACHE_PATH=/tmp/backplace-modulecache \
SWIFTPM_MODULECACHE_OVERRIDE=/tmp/backplace-swiftpmcache \
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift build --disable-sandbox

Run tests with:

HOME=/tmp/backplace-home \
CLANG_MODULE_CACHE_PATH=/tmp/backplace-modulecache \
SWIFTPM_MODULECACHE_OVERRIDE=/tmp/backplace-swiftpmcache \
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift test --disable-sandbox

Notes

  • The MVP does not attempt to reassign Spaces or Desktops.
  • Launch at login requires a normal bundled app build. It is included in the codepath, but macOS will reject registration from a non-bundled development run.
  • Automatic update checks read from the GitHub releases feed for MoonTheRipper/BackPlace.
  • Feedback can submit directly to GitHub issues without an end-user GitHub account when either of these is configured in the app build:
    • Environment variable: BACKPLACE_GITHUB_FEEDBACK_TOKEN
    • Environment variable: BACKPLACE_FEEDBACK_ENDPOINT
    • Info.plist string key: BackPlaceGitHubFeedbackToken
    • Info.plist string key: BackPlaceFeedbackEndpoint
  • If no direct feedback transport is configured, BackPlace falls back to opening a prefilled GitHub issue draft in the browser.

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages