aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Package.swift21
-rw-r--r--Sources/phbar/main.swift8
-rw-r--r--Sources/phbar/phbar.swift9
3 files changed, 15 insertions, 23 deletions
diff --git a/Package.swift b/Package.swift
index f01d543..c540ca7 100644
--- a/Package.swift
+++ b/Package.swift
@@ -1,20 +1,13 @@
// swift-tools-version: 6.3
-// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
- name: "phbar",
- targets: [
- // Targets are the basic building blocks of a package, defining a module or a test suite.
- // Targets can depend on other targets in this package and products from dependencies.
- .executableTarget(
- name: "phbar"
- ),
- .testTarget(
- name: "phbarTests",
- dependencies: ["phbar"]
- ),
- ],
- swiftLanguageModes: [.v6]
+ name: "phbar",
+ platforms: [.macOS(.v26)],
+ targets: [
+ .executableTarget(name: "phbar"),
+ .testTarget(name: "phbarTests", dependencies: ["phbar"]),
+ ],
+ swiftLanguageModes: [.v6]
)
diff --git a/Sources/phbar/main.swift b/Sources/phbar/main.swift
new file mode 100644
index 0000000..97fe72a
--- /dev/null
+++ b/Sources/phbar/main.swift
@@ -0,0 +1,8 @@
+import AppKit
+
+// Entry point. Top-level code runs on the main actor.
+let app = NSApplication.shared
+let delegate = AppDelegate()
+app.delegate = delegate
+app.setActivationPolicy(.accessory) // no Dock icon, no menu
+app.run()
diff --git a/Sources/phbar/phbar.swift b/Sources/phbar/phbar.swift
deleted file mode 100644
index e1ef8cc..0000000
--- a/Sources/phbar/phbar.swift
+++ /dev/null
@@ -1,9 +0,0 @@
-// The Swift Programming Language
-// https://docs.swift.org/swift-book
-
-@main
-struct phbar {
- static func main() {
- print("Hello, world!")
- }
-}