Skip to content

feat: add widget extension - #1

Open
itsondrej wants to merge 4 commits into
AxisNimble:mainfrom
itsondrej:itsondrej/macos-widget-app
Open

feat: add widget extension#1
itsondrej wants to merge 4 commits into
AxisNimble:mainfrom
itsondrej:itsondrej/macos-widget-app

Conversation

@itsondrej

Copy link
Copy Markdown

No description provided.

@itsondrej

Copy link
Copy Markdown
Author

Flight Wall Widget - macOS App

A simple macOS widget that displays the first plane visible within your defined triangle area.

Features

  • Pure Swift implementation
  • Displays callsign of the current flight
  • Shows route (origin → destination) or "ON GROUND" status
  • Shows altitude and velocity for airborne flights
  • Auto-refreshes every 30 seconds
  • Clean, minimal widget interface
  • Runs as background app (no dock icon)

Building the App

Prerequisites

  1. macOS 13.0 or later
  2. Xcode 14.0 or later
  3. API credentials (see Configuration section)

Steps

  1. Set up API credentials:

    Copy the example configuration file:

    cd FlightWallWidget
    cp Secrets.example.xcconfig Secrets.xcconfig

    Edit Secrets.xcconfig and fill in your actual API credentials:

  2. Configure Xcode to use the secrets file:

    • Open FlightWallWidget.xcodeproj in Xcode
    • Select the project in the navigator
    • Go to the Info tab
    • Under "Configurations", set Secrets.xcconfig for both Debug and Release from the dropdown
  3. Add the new files to your project (if not already added):

    • In Xcode, right-click on the FlightWallWidget folder
    • Choose "Add Files to FlightWallWidget"
    • Select: Secrets.xcconfig
  4. Build and run the app:

    • Press Cmd + R in Xcode, or
    • Product → Run
  5. The widget window will appear showing flight data

Configuration

Location Setup

Use the built-in location manager:

  1. Click the gear icon in the widget
  2. Add a new location or edit existing ones
  3. Use the interactive map to select your triangle's three points:
    • Center point (blue marker)
    • Left bound (green marker)
    • Right bound (red marker)
  4. Save your location and set it as active

API Keys

IMPORTANT: Never commit Secrets.xcconfig to git. It's already in .gitignore.

The app requires two sets of API credentials:

  • OpenSky Network OAuth credentials: For flight position data
  • FlightAware AeroAPI key: For flight route information

These are configured in FlightWallWidget/Secrets.xcconfig and accessed via APIConfig.swift.

Widget Display

The widget shows:

  • Callsign: Flight callsign (e.g., UAL123)
  • Route: Origin → Destination (e.g., KLGA → KSFO)
  • On Ground: Shows "ON GROUND" with orange icon if plane is on ground
  • Altitude: In meters
  • Velocity: In meters/second
  • Logo: Works in the main app not in the extension

Architecture

  • TriangleFilter.swift: Implements the triangle filtering logic using cross-product method
  • OpenSkyClient.swift: Handles API calls to OpenSky and AeroAPI
  • FlightData.swift: Data model and fetcher with 30-second refresh
  • ContentView.swift: SwiftUI interface
  • FlightWallWidgetApp.swift: App entry point

Notes

  • The app fetches data every 30 seconds
  • Only the first flight in the triangle is displayed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant