diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index cdc6b4a..64b14e9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -23,13 +23,10 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- - name: Select Xcode
+ - name: Select Xcode with Icon Composer asset support
run: |
for xcode_path in \
- "/Applications/Xcode_16.2.app" \
- "/Applications/Xcode_16.1.app" \
- "/Applications/Xcode_16.0.app" \
- "/Applications/Xcode_16.app" \
+ "/Applications/Xcode_26.6.app" \
"/Applications/Xcode.app"; do
if [ -d "$xcode_path" ]; then
echo "Selecting $xcode_path"
@@ -37,7 +34,14 @@ jobs:
break
fi
done
- xcrun actool --version || true
+ XCODE_VERSION="$(xcodebuild -version | awk '/^Xcode / { print $2; exit }')"
+ XCODE_MAJOR="${XCODE_VERSION%%.*}"
+ if [ -z "$XCODE_MAJOR" ] || [ "$XCODE_MAJOR" -lt 26 ]; then
+ echo "Xcode 26.6 or later is required to compile the latest icon assets (found: ${XCODE_VERSION:-unknown})." >&2
+ exit 1
+ fi
+ xcrun --find actool
+ xcrun actool --version
swift --version
- name: Extract Tag or Version
@@ -46,7 +50,7 @@ jobs:
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/v}"
else
- VERSION="1.1.0-${GITHUB_SHA::7}"
+ VERSION="1.1.1-${GITHUB_SHA::7}"
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
@@ -57,7 +61,7 @@ jobs:
- name: Package DMG Disk Image
run: |
export CI=true
- ./scripts/package_dmg.sh
+ VERSION="${{ steps.get_version.outputs.version }}" ./scripts/package_dmg.sh
- name: Upload DMG Artifact
uses: actions/upload-artifact@v4
diff --git a/Info.plist b/Info.plist
index db36060..af06816 100644
--- a/Info.plist
+++ b/Info.plist
@@ -21,9 +21,9 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 1.1.0
+ 1.1.1
CFBundleVersion
- 1
+ 2
LSMinimumSystemVersion
13.0
LSUIElement
diff --git a/README.md b/README.md
index 51b27d3..a7a5e3d 100644
--- a/README.md
+++ b/README.md
@@ -11,17 +11,12 @@
+
-
-
-
-
-
-
---
> [!NOTE]
@@ -32,14 +27,14 @@
## ✨ Why LifeBar?
-macOS displays a brief system pill banner when a game controller connects via Bluetooth, but **it provides no persistent menu bar battery monitor and never alerts you when your controller battery drops dangerously low during a game**.
+macOS displays a brief system banner when a game controller connects via Bluetooth, but **it provides no persistent menu bar battery monitor and does not alert you when a controller battery drops low during a game**.
To check your battery level, you usually have to leave your game, open **System Settings**, navigate to the **Game Controllers** pane, and squint at the subline. When the battery runs out, the controller simply shuts off mid-action without warning—costing you a boss fight or clutch multiplayer round.
-**LifeBar solves this with pure macOS first-party polish:**
+**LifeBar fills that gap with a focused menu bar utility:**
- **Instant Menu Bar Glanceability:** Sits quietly in your menu bar using Apple's official SF Symbol `gamecontroller` glyph, with optional live percentage display and zero Dock clutter (`LSUIElement`).
-- **macOS System Settings Aesthetics:** Pops open a clean, native card list matching macOS Sequoia/Sonoma System Settings, featuring branded PlayStation, Xbox, and Nintendo squircle badges.
-- **Apple Accessory Low-Battery HUD Notification:** Recreates Apple's exact floating frosted-glass accessory low-battery pill banner (with circular gauge, red progress arc, and alert sound) whenever your controller drops to 20% (or your chosen threshold).
+- **Compact Controller List:** Shows connected devices, charging state, and battery level in a simple system-style list.
+- **Low-Battery Alert:** Shows a compact custom alert and can mirror it to Notification Center when a controller crosses your chosen threshold.
---
@@ -48,20 +43,20 @@ To check your battery level, you usually have to leave your game, open **System
### 1. Menu Bar Status Item (Zero Dock Clutter)
- Uses Apple's official SF Symbol `gamecontroller` glyph with automatic Dark/Light menu bar template adaptation.
- Highlights with macOS's native accent selection pill while the menu is open (`NSPopoverDelegate`).
-- Runs as a lightweight macOS agent app (`LSUIElement = true`) with **0% background CPU overhead**.
+- Runs as a lightweight macOS agent app (`LSUIElement = true`) with low-frequency controller polling.
- Optional toggle to display the battery percentage directly in the menu bar next to the icon.
- Hover tooltip showing all connected controllers and their individual battery percentages.
-### 2. System Settings-Style Controller List
+### 2. Compact Controller List
- Uses Apple's `GameController.framework` (`GCController`) for reliable detection of wireless (Bluetooth) and wired game controllers:
- - **Sony PlayStation:** DualSense, DualSense Edge, DualShock 4 (branded Sony Blue squircle with `playstation.logo`).
- - **Microsoft Xbox:** Xbox Wireless Controller, Xbox Elite Series 2 (branded Xbox Green squircle with `xbox.logo`).
- - **Nintendo:** Switch Pro Controller, Joy-Cons (branded Nintendo Red squircle).
- - **MFi & HID Gamepads:** 8BitDo, Backbone One, Razer, SteelSeries, etc.
-- Displays connection status, live battery level, charging indicators (`⚡️ Battery 55% (Charging)`), and visual progress badges.
-
-### 3. Native Low-Battery HUD Notification Banner
-- Recreates Apple's native accessory low-battery pill alert:
+ - **Sony PlayStation:** DualSense, DualSense Edge, DualShock 4.
+ - **Microsoft Xbox:** Xbox Wireless Controller, Xbox Elite Series 2.
+ - **Nintendo:** Switch Pro Controller and Joy-Cons.
+ - **MFi & HID Gamepads:** 8BitDo, Backbone One, Razer, SteelSeries, and others.
+- Displays connection status, live battery level, and charging state with concise text and symbols.
+
+### 3. Low-Battery HUD Alert
+- Shows a compact custom alert when a controller falls below the selected threshold:
- **Floating Frosted Capsule:** Borderless, non-activating `NSPanel` floating smoothly at the top of your screen below the notch/menu bar.
- **Built-in Controller Glyph:** Uses Apple's official 3D controller asset (`Generic-GameController.png` from `CoreBluetoothUI`).
- **Apple Circular Gauge Ring:** Circular track, remaining battery arc in red, and centered battery percentage number in SF Pro Rounded.
@@ -70,7 +65,7 @@ To check your battery level, you usually have to leave your game, open **System
- **One-Click Test:** Includes a **"Test Low Battery Notification"** button to preview the exact HUD alert anytime.
### 4. Deep System Integration & Convenience
-- **Battery Health-Style Threshold Slider:** Smoothly adjust your preferred alert threshold using an Apple Battery Health-style slider (5% to 35% in 5% increments) with a live percentage indicator badge.
+- **Alert Threshold:** Set a low-battery threshold from 5% to 35% in 5% increments, with the selected value shown alongside the system slider.
- **Quick Settings Access:** One-click shortcut jumping directly to the macOS Game Controllers settings pane.
- **Launch at Login:** Native integration with Apple's modern `SMAppService` API.
- **Sleep & Wake Resilient:** Automatically refreshes connections and polling upon system wake.
@@ -82,7 +77,7 @@ To check your battery level, you usually have to leave your game, open **System
### Recommended: Pre-Built Release
1. **Download the App**:
- Go to the [**Releases**](https://github.com/passs0/LifeBar/releases/latest) page and download **`LifeBar-v1.1.0.dmg`** (or `LifeBar-v1.1.0.zip`).
+ Go to the [**Releases**](https://github.com/passs0/LifeBar/releases/latest) page and download **`LifeBar-v1.1.1.dmg`**.
2. **Move to Applications**:
Open the disk image and drag **`LifeBar.app`** directly into your **`/Applications`** folder.
3. **First-Launch Gatekeeper Clearance (macOS)**:
@@ -125,7 +120,7 @@ LifeBar/
## ⌨️ Building from Source
-Ensure you have **Xcode Command Line Tools** and **Swift 5.9+** installed:
+Ensure you have **Xcode Command Line Tools** and **Swift 5.9+** installed. Xcode 26.6 or later is needed to compile the four-appearance icon catalog; without `actool`, a local build uses the static fallback icon.
```bash
# Clone the repository
@@ -147,3 +142,5 @@ make install
## 📄 License
This project is licensed under the [MIT License](LICENSE).
+
+See [release notes](RELEASE_NOTES.md) and the [roadmap](ROADMAP.md).
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
new file mode 100644
index 0000000..90c3b62
--- /dev/null
+++ b/RELEASE_NOTES.md
@@ -0,0 +1,11 @@
+# LifeBar Release Notes
+
+## v1.1.1 — Quality-of-life update
+
+- Replaced decorative controller cards with compact rows and capped the popover's device-list height.
+- Collapsed settings by default so connected controllers remain the focus.
+- Improved control labels and threshold-slider accessibility.
+- Removed the duplicate legacy icon from release bundles while retaining all four dynamic appearances; stripped nonessential binary symbols.
+- Built and ad-hoc code-signed the release through GitHub Actions.
+
+The app bundle is approximately 1.9 MB; the DMG is approximately 2.3 MB.
diff --git a/ROADMAP.md b/ROADMAP.md
new file mode 100644
index 0000000..241e30b
--- /dev/null
+++ b/ROADMAP.md
@@ -0,0 +1,8 @@
+# LifeBar Roadmap
+
+These are areas for future work, not release commitments.
+
+- Improve battery reporting when controllers expose incomplete or delayed charge data.
+- Review connection and wake-from-sleep behavior across supported controller families.
+- Keep the menu bar popover quick to scan and accessible with keyboard and VoiceOver.
+- Preserve a small background footprint and avoid polling more often than needed.
diff --git a/Sources/LifeBar/MenuView.swift b/Sources/LifeBar/MenuView.swift
index 257de41..fd0f422 100644
--- a/Sources/LifeBar/MenuView.swift
+++ b/Sources/LifeBar/MenuView.swift
@@ -4,7 +4,7 @@ import ServiceManagement
public struct MenuView: View {
@ObservedObject var manager = ControllerManager.shared
@State private var launchAtLogin: Bool = (SMAppService.mainApp.status == .enabled)
- @State private var isThresholdHovered: Bool = false
+ @State private var isSettingsExpanded = false
public var previewControllers: [ControllerDevice]? = nil
private var activeControllers: [ControllerDevice] {
@@ -27,125 +27,117 @@ public struct MenuView: View {
.opacity(0.4)
// Controllers List or Empty State
- VStack(spacing: 8) {
- if activeControllers.isEmpty {
- emptyStateView
- .padding(.vertical, 16)
- } else {
- ForEach(activeControllers) { controller in
- controllerCard(controller)
+ ScrollView(showsIndicators: activeControllers.count > 3) {
+ VStack(spacing: 8) {
+ if activeControllers.isEmpty {
+ emptyStateView
+ .padding(.vertical, 16)
+ } else {
+ ForEach(activeControllers) { controller in
+ controllerCard(controller)
+ }
+ .padding(.vertical, 8)
}
- .padding(.vertical, 8)
}
}
+ .frame(maxHeight: 220)
.padding(.horizontal, 12)
Divider()
.opacity(0.4)
- // Quick Actions & Controls (Apple Control Center style)
- VStack(alignment: .leading, spacing: 2) {
- // Test Low Battery Alert
- MenuActionRow(
- icon: "bell.badge.fill",
- iconColor: .orange,
- title: "Test Low Battery Notification"
- ) {
- manager.triggerTestAlert()
- }
-
- // Show Percentage in Menu Bar
- MenuToggleRow(
- icon: "percent",
- iconColor: .secondary,
- title: "Show Percentage in Menu Bar",
- isOn: $manager.showPercentageInMenuBar
- )
-
- // Low Battery Alert Threshold Slider (Apple Battery Health style)
- VStack(alignment: .leading, spacing: 6) {
- HStack(spacing: 10) {
- Image(systemName: "slider.horizontal.2")
- .font(.system(size: 13, weight: .medium))
- .foregroundColor(.secondary)
- .frame(width: 20)
-
- Text("Alert Threshold")
- .font(.system(size: 12.5))
- .foregroundColor(.primary)
-
- Spacer()
-
- Text("\(manager.lowBatteryThreshold)%")
- .font(.system(size: 11, weight: .semibold, design: .rounded))
- .foregroundColor(.primary)
- .padding(.horizontal, 7)
- .padding(.vertical, 2)
- .background(Color.primary.opacity(0.06))
- .clipShape(Capsule())
+ DisclosureGroup("Settings", isExpanded: $isSettingsExpanded) {
+ VStack(alignment: .leading, spacing: 2) {
+ // Test Low Battery Alert
+ MenuActionRow(
+ icon: "bell.badge",
+ iconColor: .secondary,
+ title: "Test Low Battery Alert"
+ ) {
+ manager.triggerTestAlert()
}
- HStack(spacing: 8) {
- Text("5%")
- .font(.system(size: 9.5, weight: .medium, design: .rounded))
- .foregroundColor(.secondary.opacity(0.6))
-
- Slider(
- value: Binding(
- get: { Double(manager.lowBatteryThreshold) },
- set: { manager.lowBatteryThreshold = Int($0) }
- ),
- in: 5...35,
- step: 5
- )
- .controlSize(.small)
+ // Show Percentage in Menu Bar
+ MenuToggleRow(
+ icon: "percent",
+ iconColor: .secondary,
+ title: "Show Battery Percentage",
+ isOn: $manager.showPercentageInMenuBar
+ )
- Text("35%")
- .font(.system(size: 9.5, weight: .medium, design: .rounded))
- .foregroundColor(.secondary.opacity(0.6))
- }
- .padding(.leading, 30)
- .padding(.trailing, 4)
- }
- .padding(.horizontal, 10)
- .padding(.vertical, 5)
- .background(
- RoundedRectangle(cornerRadius: 6, style: .continuous)
- .fill(isThresholdHovered ? Color.primary.opacity(0.08) : Color.clear)
- )
- .onHover { hovering in
- isThresholdHovered = hovering
- }
+ // Low Battery Alert Threshold Slider
+ VStack(alignment: .leading, spacing: 6) {
+ HStack(spacing: 10) {
+ Image(systemName: "slider.horizontal.3")
+ .foregroundColor(.secondary)
+ .frame(width: 20)
- // Launch at Login Switch
- MenuToggleRow(
- icon: "arrow.clockwise",
- iconColor: .secondary,
- title: "Launch at Login",
- isOn: Binding(
- get: { launchAtLogin },
- set: { newValue in
- launchAtLogin = newValue
- setLaunchAtLogin(enabled: newValue)
+ Text("Low Battery Alert")
+ .font(.body)
+ .foregroundColor(.primary)
+
+ Spacer()
+
+ Text("\(manager.lowBatteryThreshold)%")
+ .font(.callout.monospacedDigit())
+ .foregroundColor(.secondary)
+ }
+
+ HStack(spacing: 8) {
+ Text("5%")
+ .font(.caption2)
+ .foregroundColor(.secondary)
+
+ Slider(
+ value: Binding(
+ get: { Double(manager.lowBatteryThreshold) },
+ set: { manager.lowBatteryThreshold = Int($0) }
+ ),
+ in: 5...35,
+ step: 5
+ )
+ .controlSize(.small)
+ .accessibilityLabel("Low battery alert threshold")
+ .accessibilityValue(Text("\(manager.lowBatteryThreshold) percent"))
+
+ Text("35%")
+ .font(.caption2)
+ .foregroundColor(.secondary)
}
+ .padding(.leading, 30)
+ .padding(.trailing, 4)
+ }
+ .padding(.horizontal, 10)
+ .padding(.vertical, 5)
+
+ // Launch at Login Switch
+ MenuToggleRow(
+ icon: "person.crop.circle.badge.checkmark",
+ iconColor: .secondary,
+ title: "Open at Login",
+ isOn: Binding(
+ get: { launchAtLogin },
+ set: { newValue in
+ launchAtLogin = newValue
+ setLaunchAtLogin(enabled: newValue)
+ }
+ )
)
- )
- // Open System Settings Game Controller Pane
- MenuActionRow(
- icon: "gearshape",
- iconColor: .secondary,
- title: "Game Controller Settings…"
- ) {
- openGameControllerSettings()
- } accessory: {
- Image(systemName: "arrow.up.right")
- .font(.system(size: 10, weight: .semibold))
- .foregroundColor(.secondary)
+ // Open System Settings Game Controller Pane
+ MenuActionRow(
+ icon: "gearshape",
+ iconColor: .secondary,
+ title: "Game Controller Settings…"
+ ) {
+ openGameControllerSettings()
+ }
}
+ .padding(.top, 6)
}
- .padding(.horizontal, 6)
- .padding(.vertical, 6)
+ .font(.body)
+ .padding(.horizontal, 16)
+ .padding(.vertical, 8)
Divider()
.opacity(0.4)
@@ -182,14 +174,14 @@ public struct MenuView: View {
.foregroundColor(.secondary)
Text("Game Controllers")
- .font(.system(size: 13, weight: .semibold))
+ .font(.headline)
.foregroundColor(.primary)
Spacer()
if activeControllers.isEmpty {
Text("No Devices")
- .font(.system(size: 11, weight: .medium))
+ .font(.caption)
.foregroundColor(.secondary)
.padding(.horizontal, 7)
.padding(.vertical, 2)
@@ -202,7 +194,7 @@ public struct MenuView: View {
.frame(width: 6, height: 6)
Text("\(activeControllers.count) Connected")
- .font(.system(size: 11, weight: .medium, design: .rounded))
+ .font(.caption)
.foregroundColor(.secondary)
}
.padding(.horizontal, 8)
@@ -213,87 +205,46 @@ public struct MenuView: View {
}
}
- // MARK: - Controller Card (Matches Image 2 & System Settings)
+ // MARK: - Controller Row
private func controllerCard(_ controller: ControllerDevice) -> some View {
- HStack(spacing: 12) {
- // Squircle Brand Icon (Matches macOS Settings Image 2)
- ZStack {
- RoundedRectangle(cornerRadius: 8, style: .continuous)
- .fill(controller.brand.brandGradient)
- .frame(width: 36, height: 36)
- .shadow(color: controller.brand.brandColor.opacity(0.30), radius: 3, y: 1.5)
-
- Image(systemName: controller.brand.iconName)
- .font(.system(size: 17, weight: .medium))
- .foregroundColor(.white)
- }
+ HStack(spacing: 10) {
+ Image(systemName: controller.brand.iconName)
+ .font(.title3)
+ .foregroundStyle(.secondary)
+ .frame(width: 24)
- // Info Details
- VStack(alignment: .leading, spacing: 2.5) {
+ VStack(alignment: .leading, spacing: 3) {
Text(controller.name)
- .font(.system(size: 13, weight: .medium))
+ .font(.body)
.foregroundColor(.primary)
.lineLimit(1)
HStack(spacing: 5) {
- Text("Connected -")
- .font(.system(size: 11))
- .foregroundColor(.secondary)
-
Image(systemName: controller.batterySymbolName)
- .font(.system(size: 11.5))
.symbolRenderingMode(.hierarchical)
- .foregroundColor(
+ .foregroundStyle(
controller.isLowBattery ? .red :
(controller.isCharging ? .green : .secondary)
)
- if let percent = controller.batteryPercent {
- Text(controller.isCharging ? "Battery \(percent)% (Charging)" : "Battery \(percent)%")
- .font(.system(size: 11))
- .foregroundColor(.secondary)
- }
+ Text(controller.isCharging ? "Charging" : "Connected")
+ .font(.caption)
+ .foregroundColor(.secondary)
}
}
Spacer()
- // Mini Battery Gauge (Apple Battery Widget Circular Arc)
if let percent = controller.batteryPercent {
- let fraction = CGFloat(max(0.01, min(1.0, Double(percent) / 100.0)))
-
- ZStack {
- Circle()
- .stroke(Color.primary.opacity(0.12), lineWidth: 2.2)
- .frame(width: 24, height: 24)
-
- Circle()
- .trim(from: 0, to: fraction)
- .stroke(
- controller.isLowBattery ? Color.red :
- (controller.isCharging ? Color.green : Color.primary.opacity(0.7)),
- style: StrokeStyle(lineWidth: 2.2, lineCap: .round)
- )
- .rotationEffect(.degrees(-90))
- .frame(width: 24, height: 24)
-
- Text("\(percent)")
- .font(.system(size: 9.5, weight: .semibold, design: .rounded))
- .foregroundColor(controller.isLowBattery ? .red : .primary)
- .monospacedDigit()
- }
+ Text("\(percent)%")
+ .font(.callout.monospacedDigit())
+ .foregroundStyle(controller.isLowBattery ? .red : .primary)
}
}
- .padding(.horizontal, 10)
- .padding(.vertical, 8)
- .background(
- RoundedRectangle(cornerRadius: 10, style: .continuous)
- .fill(Color(nsColor: .controlBackgroundColor).opacity(0.65))
- )
- .overlay(
- RoundedRectangle(cornerRadius: 10, style: .continuous)
- .strokeBorder(Color(nsColor: .separatorColor).opacity(0.4), lineWidth: 0.5)
- )
+ .padding(.horizontal, 8)
+ .padding(.vertical, 7)
+ .contentShape(Rectangle())
+ .accessibilityElement(children: .combine)
}
// MARK: - Empty State
@@ -304,11 +255,11 @@ public struct MenuView: View {
.foregroundColor(.secondary.opacity(0.5))
Text("No Controllers Connected")
- .font(.system(size: 12.5, weight: .medium))
+ .font(.body)
.foregroundColor(.primary.opacity(0.85))
Text("Connect a Bluetooth controller or plug in via USB")
- .font(.system(size: 11))
+ .font(.callout)
.foregroundColor(.secondary)
}
.frame(maxWidth: .infinity)
@@ -368,7 +319,7 @@ struct MenuActionRow: View {
.frame(width: 20)
Text(title)
- .font(.system(size: 12.5))
+ .font(.body)
.foregroundColor(.primary)
Spacer()
@@ -406,7 +357,7 @@ struct MenuToggleRow: View {
.frame(width: 20)
Text(title)
- .font(.system(size: 12.5))
+ .font(.body)
.foregroundColor(.primary)
Spacer()
@@ -415,6 +366,7 @@ struct MenuToggleRow: View {
.labelsHidden()
.toggleStyle(.switch)
.controlSize(.mini)
+ .accessibilityLabel(title)
}
.padding(.horizontal, 10)
.padding(.vertical, 3.5)
diff --git a/build.sh b/build.sh
index 16e0ed4..ed62938 100755
--- a/build.sh
+++ b/build.sh
@@ -20,27 +20,48 @@ mkdir -p "$RESOURCES_DIR"
cp "$DIR/.build/release/LifeBar" "$MACOS_DIR/LifeBar"
chmod +x "$MACOS_DIR/LifeBar"
+strip -rSTx "$MACOS_DIR/LifeBar"
cp "$DIR/Info.plist" "$CONTENTS_DIR/Info.plist"
-# If an AppIcon.icns exists in Resources or root, copy it
-if [ -f "$DIR/AppIcon.icns" ]; then
- echo "==> Found AppIcon.icns, adding to bundle..."
- cp "$DIR/AppIcon.icns" "$RESOURCES_DIR/AppIcon.icns"
+if [ -d "$DIR/assets/LifeBar.icon.xcassets" ]; then
+ if xcrun --find actool >/dev/null 2>&1; then
+ echo "==> Compiling the Light, Dark, Clear, and Tinted app icon variants..."
+ PARTIAL_PLIST="$(mktemp "$APP_DIR/icon-partial.XXXXXX")"
+ xcrun actool "$DIR/assets/LifeBar.icon.xcassets" \
+ --compile "$RESOURCES_DIR" \
+ --platform macosx \
+ --minimum-deployment-target 13.0 \
+ --app-icon LifeBar \
+ --output-partial-info-plist "$PARTIAL_PLIST" \
+ --output-format human-readable-text
+ python3 - "$PARTIAL_PLIST" "$CONTENTS_DIR/Info.plist" <<'PY'
+import plistlib, sys
+with open(sys.argv[1], "rb") as f:
+ additions = plistlib.load(f)
+with open(sys.argv[2], "rb") as f:
+ info = plistlib.load(f)
+info.update(additions)
+with open(sys.argv[2], "wb") as f:
+ plistlib.dump(info, f)
+PY
+ rm -f "$PARTIAL_PLIST"
+ elif [ "${CI:-}" = "true" ]; then
+ echo "Error: Xcode with actool is required to build the dynamic app icon." >&2
+ exit 1
+ else
+ echo "Warning: actool is unavailable; using the legacy static icon for this local build." >&2
+ fi
fi
-if [ -d "$DIR/assets/LifeBar.icon.xcassets" ] && xcrun actool --version >/dev/null 2>&1; then
- echo "==> Compiling dynamic Assets.car..."
- xcrun actool "$DIR/assets/LifeBar.icon.xcassets" \
- --compile "$RESOURCES_DIR" \
- --platform macosx \
- --minimum-deployment-target 13.0 \
- --app-icon LifeBar \
- --output-partial-info-plist /tmp/lifebar_partial.plist \
- --output-format human-readable-text || true
+# Prefer actool's compact ICNS fallback while keeping all four appearances in
+# Assets.car. Copy the larger static icon only when this machine lacks actool.
+if [ ! -f "$RESOURCES_DIR/LifeBar.icns" ] && [ -f "$DIR/AppIcon.icns" ]; then
+ cp "$DIR/AppIcon.icns" "$RESOURCES_DIR/AppIcon.icns"
fi
echo "==> Ad-hoc code signing..."
codesign --force --deep --sign - "$APP_DIR"
+codesign --verify --deep --strict "$APP_DIR"
echo "==> Successfully created $APP_DIR"
echo "==> To run: open \"$APP_DIR\""
diff --git a/scripts/package_dmg.sh b/scripts/package_dmg.sh
index cd89902..3787086 100755
--- a/scripts/package_dmg.sh
+++ b/scripts/package_dmg.sh
@@ -5,7 +5,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$SCRIPT_DIR"
APP_NAME="LifeBar"
-VERSION="1.1.0"
+VERSION="${VERSION:-1.1.1}"
DMG_NAME="LifeBar-v${VERSION}.dmg"
STAGING_DIR="/tmp/cb_dmg_staging"
RW_DMG="/tmp/cb_rw.dmg"