Skip to content

Building from source

Roy Padina edited this page Oct 3, 2026 · 2 revisions

Building from source

A Swift Package (Swift 6, macOS 14+). Requires Xcode or the Xcode command line tools.

git clone https://github.com/roypadina/window-organizer.git
cd window-organizer
swift test                       # core logic tests (Swift Testing)
Scripts/package_app.sh           # writes dist/Window Organizer.app
open "dist/Window Organizer.app"

Layout

Path What
Sources/WindowOrganizerCore Pure, tested logic: preferences, shortcuts, target rules, action policy
Sources/WindowOrganizerApp SwiftUI MenuBarExtra app: global shortcuts (Carbon hot keys), Accessibility window actions, settings UI, login item
Tests/WindowOrganizerCoreTests Tests for the core
Assets/icons SVG sources plus generated AppIcon.icns and template menubar.png / menubar@2x.png
Scripts/package_app.sh Builds the .app bundle
Scripts/make_icons.sh Regenerates icons from the SVGs (needs brew install librsvg)

What package_app.sh does

  1. swift build -c release.
  2. Creates dist/Window Organizer.app with the binary, Info.plist (LSUIElement, so no Dock icon) and the icons.
  3. Signs it: CODE_SIGN_IDENTITY if set, else the first code-signing identity in your keychain, else ad-hoc.

Ad-hoc signing changes the code hash on every build, so macOS forgets the Accessibility grant after each rebuild. A self-signed code-signing certificate (Keychain Access → Certificate Assistant → Create a Certificate, type Code Signing) keeps the grant across rebuilds.

Release zip

RELEASE=1 Scripts/package_app.sh

Signs the same way and writes dist/Window-Organizer.zip plus its SHA-256, the asset the Homebrew cask downloads.

swift run

swift run WindowOrganizerApp is fine for quick checks, but it is not a bundled app: it has no bundled icons (falls back to an SF Symbol), and Accessibility and Launch at Login behave differently. Use the packaged app for real testing.

Contributing

See CONTRIBUTING.md.

Clone this wiki locally