Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7064376
Make the seagull menu shorter and clearer, and move the power setting…
kewonit Nov 12, 2026
cf1dd3e
Sell Outbound for 1 Mac on the site, keep earlier keys and the app's …
kewonit Nov 12, 2026
dc7a903
Offer 1 Mac in the app's buy window, and buy it from the app
kewonit Nov 13, 2026
e381c4d
Test what the app's Buy asks for, Polar's refusals, and the menu's sa…
kewonit Nov 13, 2026
589e4d5
Lay Settings out like System Settings
kewonit Nov 13, 2026
c902180
Add Flight and Places to Settings, and choose when it rests
kewonit Nov 18, 2026
fc7408e
Build against the SDK it is really built with
kewonit Nov 18, 2026
54acc61
Lay Settings out as System Settings does, and let places be reordered
kewonit Nov 18, 2026
ae3b63f
Drag places by their whole row, with no handle drawn
kewonit Nov 18, 2026
f064899
Order the places in a sheet of their own, numbered, with arrows and drag
kewonit Nov 18, 2026
49975ea
Fix what the review found in the new settings
kewonit Nov 18, 2026
d4772c1
Keep the buy window's title off the painting
kewonit Nov 18, 2026
e41d696
Sell the 1-Mac product: fill in its Polar ids
kewonit Nov 18, 2026
49d3670
Offer the customer portal when a key is on all its Macs
kewonit Nov 18, 2026
c388031
Site: the 1.9 changelog, and the menu's new names in the FAQ and support
kewonit Nov 18, 2026
40c52e5
Fix what the second review found
kewonit Nov 19, 2026
a187765
Leave the desktop picture alone while the Mac shuts down
kewonit Nov 14, 2026
c76c66f
Drop a painting still on its way when the Mac starts to shut down
kewonit Nov 14, 2026
26424f1
Add the shutdown fix to the 1.9 changelog
kewonit Nov 20, 2026
bd5c66d
Paint again after a cancelled shutdown that dropped a painting
kewonit Nov 21, 2026
f42b570
Forget a key on Deactivate only once the store agrees it is gone
kewonit Nov 21, 2026
7b82379
Leave the painting on the desktop through every shutdown
kewonit Nov 21, 2026
c3c6a1f
Date the 3-Mac cutoff on the day 1 Mac goes on sale
kewonit Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,595 changes: 3,973 additions & 1,622 deletions Configuration/Localizable.xcstrings

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ paid license.
2. Using Outbound. Any other use, including running Outbound as your desktop
wallpaper, needs a license bought from https://outbound.edbn.me. This
applies equally to the official download and to builds you make yourself.
One license covers one person on up to three Macs they use.
One license covers one person on one Mac they use at a time, or on as
many Macs as were offered when it was bought: a license bought before
21 November 2026 covers up to three.

3. No redistribution. You may not distribute, sell, sublicense or publish
Outbound or any work based on it, in source or binary form, except for
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<img src="Website/public/assets/day/night.jpg" alt="Night" width="24%">
</p>

Needs a Mac with Apple silicon and macOS 13 Ventura or newer. $4.99 + tax, once, for up to 3 Macs.
Needs a Mac with Apple silicon and macOS 13 Ventura or newer. $4.99 + tax, once, for 1 Mac.

## Build

Expand Down
254 changes: 149 additions & 105 deletions Sources/Outbound/App.swift

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions Sources/Outbound/DisplayManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ final class DisplayManager {
/// Called as a wallpaper comes up over the desktop picture.
var onReveal: () -> Void = {}

/// Called once the flight has come to rest as the Mac asks whether to shut down, restart or log out.
var onSessionSettled: () -> Void = {}

var isPaused: Bool {
get { globalHolds.contains(.user) }
set { set(.user, newValue) }
Expand All @@ -192,18 +189,16 @@ final class DisplayManager {
}
return
}
// Already at rest, as when windows cover the desktop: it stays just so, and the painting is of that.
// Already at rest, as when windows cover the desktop: it stays just so.
if world.isHeld {
set(.sessionEnding, true)
onSessionSettled()
return
}
world.settle()
let settled = DispatchWorkItem { [weak self] in
MainActor.assumeIsolated {
self?.sessionSettling = nil
self?.set(.sessionEnding, true)
self?.onSessionSettled()
}
}
sessionSettling = settled
Expand Down
2 changes: 1 addition & 1 deletion Sources/Outbound/Exporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ enum Exporter {
let cycle = 9.0
let phase = t.truncatingRemainder(dividingBy: cycle) / cycle
let moving = min(phase / 0.7, 1)
let eased = moving * moving * (3 - 2 * moving)
let eased = Easing.smoothstep(moving)
let loop = (t / cycle).rounded(.down) + eased
let x = 0.5 + 0.3 * sin(loop * 2.1 + 0.4)
let y = 0.5 + 0.24 * sin(loop * 3.3 + 1.2)
Expand Down
8 changes: 7 additions & 1 deletion Sources/Outbound/Licensing/ActivationWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ final class ActivationWindow {
window.title = String(localized: "Unlock Outbound")
window.showsOnlyCloseButton()
window.titlebarAppearsTransparent = true
// Named for Mission Control and VoiceOver, not over the painting: since Outbound is built for the current
// SDK, macOS draws a title on a transparent bar.
window.titleVisibility = .hidden
window.opensWhereTheUserIs()
window.isReleasedWhenClosed = false
window.center()
Expand Down Expand Up @@ -131,7 +134,7 @@ private struct ActivationView: View {
.buttonStyle(.borderedProminent)
.controlSize(.large)
.disabled(license.busy)
Text("$4.99 + tax, once. Up to 3 Macs.")
Text("$4.99 + tax, once. For 1 Mac.")
.font(.callout)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
Expand Down Expand Up @@ -159,6 +162,9 @@ private struct ActivationView: View {
.font(.callout)
.foregroundStyle(.red)
.fixedSize(horizontal: false, vertical: true)
if license.offersPortal {
Button("Open Customer Portal") { NSWorkspace.shared.open(Store.portalURL) }
}
}
}

Expand Down
51 changes: 46 additions & 5 deletions Sources/Outbound/Licensing/License.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,26 @@ final class LicenseController: ObservableObject {
@Published private(set) var record: LicenseRecord?
@Published private(set) var status: LicenseStatus
@Published private(set) var busy = false
@Published private(set) var message: String?
@Published private(set) var message: String? {
// A new message, or none, is not about the failure before it.
didSet { failure = nil }
}
/// The store's refusal the message tells of, when it is one.
@Published private(set) var failure: Polar.Failure?

/// The key is on as many Macs as it allows, which only freeing one in the customer portal, or in Settings on the
/// other Mac, can fix: worth a button that goes there.
var offersPortal: Bool { Self.offersPortal(for: failure) }

nonisolated static func offersPortal(for failure: Error?) -> Bool {
if case .tooManyMacs = failure as? Polar.Failure { return true }
return false
}

private func fail(_ error: Error) {
message = error.localizedDescription
failure = error as? Polar.Failure
}
/// A purchase started from the app is being watched for.
@Published private(set) var waitingForPurchase = false
var onChange: (Bool) -> Void = { _ in }
Expand Down Expand Up @@ -45,6 +64,14 @@ final class LicenseController: ObservableObject {
Host.current().localizedName ?? "Mac"
}

/// How the license stands on this Mac, in a few words, for Settings. A key refunded, or not checked for too long,
/// is kept but no longer unlocks it: the message says which.
var statusLine: String {
if !Self.isGated { return String(localized: "Development build") }
if record == nil || !unlocks { return String(localized: "Not active on this Mac") }
return String(localized: "Active on \(macName)")
}

func activate(_ typed: String) async {
let key = LicenseStatus.clean(typed)
guard !key.isEmpty, !busy else { return }
Expand All @@ -54,14 +81,14 @@ final class LicenseController: ObservableObject {
do {
try await activateKey(key)
} catch {
message = error.localizedDescription
fail(error)
}
}

private func activateKey(_ key: String) async throws {
let previous = record
// The same key pasted again, say after a long time offline: confirm this Mac's activation rather than
// taking another of the key's three.
// taking another of the key's activations.
if let previous, previous.key == key, let confirmed = try? await Polar().validate(previous) {
store(confirmed)
return
Expand Down Expand Up @@ -188,7 +215,7 @@ final class LicenseController: ObservableObject {
// Paid and the key is ready; only the store was out of reach. Keep trying.
return .waiting
} catch {
message = error.localizedDescription
fail(error)
return .failed
}
if pending?.checkout == checkout { stopWatching() }
Expand Down Expand Up @@ -228,8 +255,22 @@ final class LicenseController: ObservableObject {
do {
try await Polar().deactivate(record)
forget()
} catch Polar.Failure.noLongerActive, Polar.Failure.unknownKey {
// The store says it holds nothing of this key to free any more. Were that answer mistaken, the store would
// go on counting this Mac with nothing kept here to free it, so the key goes only once a check agrees.
do {
let confirmed = try await Polar().validate(record)
guard self.record == record else { return }
store(confirmed)
fail(Polar.Failure.server(404))
} catch Polar.Failure.noLongerActive, Polar.Failure.unknownKey {
guard self.record == record else { return }
forget()
} catch {
fail(error)
}
} catch {
message = error.localizedDescription
fail(error)
}
}

Expand Down
14 changes: 9 additions & 5 deletions Sources/Outbound/Licensing/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import Security
/// site's API holds the only one.
enum Store {
static let organizationID = "687b5988-7a78-4642-968c-19a2d2ab3da7"
/// Polar's checkout for Outbound. The app normally asks the site for a checkout of its own, so it can watch
/// for the purchase; this link is the fallback when the site can't be reached.
static let checkoutURL = URL(string: "https://buy.polar.sh/polar_cl_2WXlRKhLcEPJSQ0KnyuM3gQNFurhMbUrD99Gl4EQHLA")!
/// Polar's checkout for Outbound for 1 Mac. The app normally asks the site for a checkout of its own, so it can
/// watch for the purchase; this link is the fallback when the site can't be reached.
static let checkoutURL = URL(string: "https://buy.polar.sh/polar_cl_6pzC7vjcRHCZEWxV1M5mQ6zrmGvVYPv3dJpzc2Qv9a9")!
/// Where buyers find their key again and free up a Mac, signing in with a code sent to their email.
static let portalURL = URL(string: "https://polar.sh/edbnme/portal")!
static let price = "$4.99"
Expand Down Expand Up @@ -72,7 +72,9 @@ struct Polar {
switch self {
case .unknownKey: String(localized: "That key wasn't recognised. Check it against the one on your thank-you page or in your customer portal.")
case .noLongerActive: String(localized: "That key is no longer active, perhaps because the purchase was refunded.")
case .tooManyMacs: String(localized: "This key is already in use on three Macs. Free one up in Outbound's settings on that Mac, or in your customer portal, then try again.")
// A Mac that lost its record (a failed save, a reset keychain, a new account) takes another activation of
// the same key, and Polar can't tell it is the same Mac: only the portal frees the one it had.
case .tooManyMacs: String(localized: "This key is already in use on as many Macs as it allows, maybe on this Mac before. Free one up in your customer portal, or in Outbound's Settings on another Mac, then try again.")
case .malformed: String(localized: "That doesn't look like an Outbound license key.")
case .busy: String(localized: "Too many tries in a row. Wait a moment, then try again.")
case .offline: String(localized: "Outbound couldn't reach the store. Check your connection and try again.")
Expand Down Expand Up @@ -177,8 +179,10 @@ struct Shop {

var session = URLSession.shared

/// A checkout for what the buy window offers: 1 Mac. Versions up to 1.8.1 ask with nothing, and the site sells
/// them the 3 Macs their window offered.
func startCheckout() async throws -> Checkout {
let (data, response) = try await session.data(for: request("checkout", body: [:]))
let (data, response) = try await session.data(for: request("checkout", body: ["macs": "1"]))
guard (response as? HTTPURLResponse)?.statusCode == 200 else { throw Polar.Failure.offline }
return try Store.decoder().decode(Checkout.self, from: data)
}
Expand Down
89 changes: 78 additions & 11 deletions Sources/Outbound/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ final class Preferences: ObservableObject {
var title: String {
switch self {
case .slow: String(localized: "Slow")
case .gentle: String(localized: "Gentle")
case .brisk: String(localized: "Brisk")
case .gentle: String(localized: "Medium")
case .brisk: String(localized: "Fast")
}
}
/// Metres per second over the ground.
Expand All @@ -26,18 +26,38 @@ final class Preferences: ObservableObject {
}

/// Minutes over each place, or none to stay over the one in view. Six and twelve, offered once, are not any more.
/// The menu offers them as when to go on to the next place.
enum Stay: Int, CaseIterable, Identifiable {
case short = 20, long = 30, hour = 60, forever = 0
var id: Self { self }
var title: String {
switch self {
case .hour: String(localized: "An hour")
case .forever: String(localized: "Do not change")
default: String(localized: "\(rawValue) minutes")
case .short: String(localized: "After 20 Minutes")
case .long: String(localized: "After 30 Minutes")
case .hour: String(localized: "After an Hour")
case .forever: String(localized: "Never")
}
}
}

/// How long nobody uses the Mac before it holds still, in minutes, or never.
enum Away: Int, CaseIterable, Identifiable {
case two = 2, five = 5, fifteen = 15, half = 30, never = 0
var id: Self { self }
var title: String {
switch self {
case .two: String(localized: "After 2 Minutes")
case .five: String(localized: "After 5 Minutes")
case .fifteen: String(localized: "After 15 Minutes")
case .half: String(localized: "After 30 Minutes")
// Its own key: the Next Place menu's Never is translated as staying put.
case .never: String(localized: "Never (away)", defaultValue: "Never")
}
}
/// Seconds without anyone at the Mac before it holds still, or nil.
var seconds: TimeInterval? { self == .never ? nil : TimeInterval(rawValue * 60) }
}

// Each is saved only when it changes, so what is saved is what someone chose, and a default changed later still
// reaches everyone who never did. Versions before 1.6 saved every one whenever any changed, and as they quit.
@Published var light: World.Light { didSet { defaults.set(light.rawValue, forKey: "light") } }
Expand All @@ -49,8 +69,14 @@ final class Preferences: ObservableObject {
}
/// Keep a painting of the current view as the desktop picture, so the lock screen shows it too.
@Published var matchingStill: Bool { didSet { defaults.set(matchingStill, forKey: "matchingStill") } }
/// Hold still after five minutes without anyone at the Mac.
@Published var restsWhenAway: Bool { didSet { defaults.set(restsWhenAway, forKey: "restsWhenAway") } }
/// Hold still after a while without anyone at the Mac: whether at all is kept where it always was, under
/// `restsWhenAway`, and how long under `restAfter`.
@Published var away: Away {
didSet {
if (away == .never) != (oldValue == .never) { defaults.set(away != .never, forKey: "restsWhenAway") }
if away != .never { defaults.set(away.rawValue, forKey: "restAfter") }
}
}
/// Hold the flight while every display's desktop is hidden, as by full-screen apps, so nothing is drawn that nobody
/// can see: on by default. Off, it flies on unseen, at the 24 frames a second of a covered desktop, and the view
/// has moved on when the desktop comes back.
Expand All @@ -59,6 +85,39 @@ final class Preferences: ObservableObject {
@Published var paperEdge: Bool { didSet { defaults.set(paperEdge, forKey: "paperBorder") } }
/// The place's name in the corner of the desktop. On until it is turned off.
@Published var showsPlaceName: Bool { didSet { defaults.set(showsPlaceName, forKey: "showsPlaceName") } }
/// The land comes straight down the screen, with no drift from side to side.
@Published var fliesStraight: Bool { didSet { defaults.set(fliesStraight, forKey: "fliesStraight") } }
/// The gull over the desktop, and in the painting of it.
@Published var showsBird: Bool { didSet { defaults.set(showsBird, forKey: "showsGull") } }
/// The gull chases the pointer for a while after it moves over the desktop.
@Published var followsPointer: Bool { didSet { defaults.set(followsPointer, forKey: "followsPointer") } }
/// Places left out of the round, by id: what is left out rather than what is in, so places added later join it.
@Published var skippedPlaces: Set<String> { didSet { defaults.set(skippedPlaces.sorted(), forKey: "skippedPlaces") } }
/// Moves on to a place picked at random rather than the next one.
@Published var shufflesPlaces: Bool { didSet { defaults.set(shufflesPlaces, forKey: "shufflesPlaces") } }
/// The order the flight goes through the places in, by id, every place once. The usual order isn't saved, so it
/// stays Outbound's own, with any places added later where they belong in it.
@Published var placeOrder: [String] {
didSet {
// Set again here, it isn't observed again.
let ordered = Self.ordered(placeOrder)
if ordered != placeOrder { placeOrder = ordered }
if placeOrder == Self.usualOrder { defaults.removeObject(forKey: "placeOrder") } else {
defaults.set(placeOrder, forKey: "placeOrder")
}
}
}

static var usualOrder: [String] { Place.all.map(\.id) }

/// Every place once, in the order given: places no longer painted are let go, and any not in it, as one added in an
/// update since it was saved, come at the end, in Outbound's own order.
static func ordered(_ ids: [String]) -> [String] {
let known = Set(usualOrder)
var seen = Set<String>()
let kept = ids.filter { known.contains($0) && seen.insert($0).inserted }
return kept + usualOrder.filter { !seen.contains($0) }
}
/// The place to start from next launch.
@Published var lastPlace: String { didSet { defaults.set(lastPlace, forKey: "lastPlace") } }

Expand All @@ -74,14 +133,22 @@ final class Preferences: ObservableObject {
stay = (defaults.object(forKey: "stay") as? Int).flatMap(Stay.init(rawValue:)) ?? .short
batteryMode = PowerState.BatteryMode(rawValue: defaults.string(forKey: "batteryMode") ?? "") ?? .gentle
matchingStill = defaults.object(forKey: "matchingStill") as? Bool ?? true
restsWhenAway = defaults.object(forKey: "restsWhenAway") as? Bool ?? true
away = defaults.object(forKey: "restsWhenAway") as? Bool == false ? .never
: (defaults.object(forKey: "restAfter") as? Int).flatMap(Away.init(rawValue:)).flatMap { $0 == .never ? nil : $0 }
?? .five
// Kept under a new name since it came on by default. 1.5 saved it as off for everyone as it quit, so off there
// can't be told from never chosen; on there was chosen, and is on here too.
pausesWhenHidden = defaults.object(forKey: "holdsWhenHidden") as? Bool ?? true
// Kept under a new name since the border went off by default: the old one was saved as on for everyone who
// had run Outbound by then, whether they asked for it or not.
paperEdge = defaults.object(forKey: "paperBorder") as? Bool ?? false
showsPlaceName = defaults.object(forKey: "showsPlaceName") as? Bool ?? true
fliesStraight = defaults.object(forKey: "fliesStraight") as? Bool ?? false
showsBird = defaults.object(forKey: "showsGull") as? Bool ?? true
followsPointer = defaults.object(forKey: "followsPointer") as? Bool ?? true
skippedPlaces = Set(defaults.stringArray(forKey: "skippedPlaces") ?? [])
shufflesPlaces = defaults.object(forKey: "shufflesPlaces") as? Bool ?? false
placeOrder = Self.ordered(defaults.stringArray(forKey: "placeOrder") ?? [])
lastPlace = defaults.string(forKey: "lastPlace") ?? Place.first.id
// What the old names hold says nothing about what anyone chose.
defaults.removeObject(forKey: "pausesWhenHidden")
Expand All @@ -93,9 +160,9 @@ final class Preferences: ObservableObject {
extension World.Light {
var title: String {
switch self {
case .yourTime: String(localized: "Follows your clock")
case .placeTime: String(localized: "The place's own time")
case .alwaysDay: String(localized: "Always daytime")
case .yourTime: String(localized: "Follow My Clock")
case .placeTime: String(localized: "Local Time There")
case .alwaysDay: String(localized: "Always Daytime")
}
}
}
Expand Down
Loading
Loading