Skip to content

Commit b64e265

Browse files
Bump to b44
1 parent ccae525 commit b64e265

5 files changed

Lines changed: 23 additions & 18 deletions

File tree

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Once that's done, you can manually send the battery info to your configured webh
2525
- [x] HTTP interaction with Discord webhook
2626
- [x] Manual sending of battery info
2727
- [x] Send battery info using Shortcuts
28-
- [ ] Update MessageBuilder.swift to support different power events
28+
- [x] Update MessageBuilder.swift to support different power events
2929
- [x] Automations support with Shortcuts Automations
3030
- [x] macOS-specific UI elements (CommandMenu and MenuBarExtra)
3131
- [ ] Preview how the embed will show
@@ -34,17 +34,14 @@ Once that's done, you can manually send the battery info to your configured webh
3434
- [ ] ?
3535

3636
## Compatibility and Dependencies
37-
- macOS 13.0 or later
38-
- Native (AppKit) macOS build
39-
- iOS/iPadOS/tvOS/macCatalyst 15.0 or later
40-
- iOS/tvOS build or Mac Catalyst build
37+
- iOS/iPadOS 15.0 or later
4138
- watchOS 8 or later
42-
- visionOS 1 or later
39+
- tvOS 15.0 or later
40+
- macOS 13.0 or later
41+
- visionOS 1.0 or later
4342

4443
Support for the Shortcuts app requires iOS/iPadOS/watchOS 16 or later.
4544

46-
<sub>(macCatalyst 15.0 = macOS Monterey 12.0)</sub>
47-
4845
## Building
4946
Open in Xcode, change PROJECT_IDENTIFIER at the bottom of project build settings, set codesign identity, then build.
5047

dcbattwebhook-swift.xcodeproj/project.pbxproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
55B272012B03114800BD8A36 /* DiscordPreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55B271FF2B03114800BD8A36 /* DiscordPreviewView.swift */; };
4747
55B4E8E829316C0600492C77 /* MessageBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55B4E8E729316C0600492C77 /* MessageBuilder.swift */; };
4848
55B4E8EA2931742300492C77 /* EmbedStructs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55B4E8E92931742300492C77 /* EmbedStructs.swift */; };
49+
55CE77562B0586390094B98D /* SettingsViewmacOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55CE77552B0586390094B98D /* SettingsViewmacOS.swift */; };
50+
55CE77572B0586390094B98D /* SettingsViewmacOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55CE77552B0586390094B98D /* SettingsViewmacOS.swift */; };
4951
55E7AEAD29257AF1002E6869 /* SettingsUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55E7AEAC29257AF1002E6869 /* SettingsUtils.swift */; };
5052
55ED8938291F628700CB170C /* SettingsValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55ED8937291F628700CB170C /* SettingsValidator.swift */; };
5153
55F26F3C2AF6F56E00AB8E1C /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 55F26F3B2AF6F56E00AB8E1C /* Credits.rtf */; };
@@ -102,6 +104,7 @@
102104
55B271FF2B03114800BD8A36 /* DiscordPreviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiscordPreviewView.swift; sourceTree = "<group>"; };
103105
55B4E8E729316C0600492C77 /* MessageBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageBuilder.swift; sourceTree = "<group>"; };
104106
55B4E8E92931742300492C77 /* EmbedStructs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmbedStructs.swift; sourceTree = "<group>"; };
107+
55CE77552B0586390094B98D /* SettingsViewmacOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewmacOS.swift; sourceTree = "<group>"; };
105108
55E7AEA929253E8F002E6869 /* DefaultsUsed.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = DefaultsUsed.md; sourceTree = "<group>"; };
106109
55E7AEAC29257AF1002E6869 /* SettingsUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsUtils.swift; sourceTree = "<group>"; };
107110
55ED8937291F628700CB170C /* SettingsValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsValidator.swift; sourceTree = "<group>"; };
@@ -160,13 +163,14 @@
160163
children = (
161164
55F26F3B2AF6F56E00AB8E1C /* Credits.rtf */,
162165
550348C7291D7FB9006551B0 /* dcbattwebhook_swiftApp.swift */,
163-
553CD2B32AF65288006D3402 /* MenuBarExtraView.swift */,
164166
55F26F3F2AF740E600AB8E1C /* WelcomeView.swift */,
165167
550348C9291D7FB9006551B0 /* ContentView.swift */,
166168
550348DC291DA3BC006551B0 /* HomeUIView.swift */,
167169
55B271FF2B03114800BD8A36 /* DiscordPreviewView.swift */,
168170
55E7AEAC29257AF1002E6869 /* SettingsUtils.swift */,
169171
550348D6291D84E1006551B0 /* SettingsView.swift */,
172+
55CE77552B0586390094B98D /* SettingsViewmacOS.swift */,
173+
553CD2B32AF65288006D3402 /* MenuBarExtraView.swift */,
170174
55A9E5322AF7669F0091D1A6 /* HelpView.swift */,
171175
55A9E5352AF772E80091D1A6 /* HelpViews */,
172176
55950C5B291DDCDF00F1CAD8 /* AboutView.swift */,
@@ -316,6 +320,7 @@
316320
buildActionMask = 2147483647;
317321
files = (
318322
5173E4162A78EE980076663F /* dcbattwebhook_swiftApp.swift in Sources */,
323+
55CE77572B0586390094B98D /* SettingsViewmacOS.swift in Sources */,
319324
55A9E53B2AF7739D0091D1A6 /* WhatIsAWebhook.swift in Sources */,
320325
5173E4172A78EE980076663F /* AboutView.swift in Sources */,
321326
5173E4182A78EE980076663F /* SettingsUtils.swift in Sources */,
@@ -354,6 +359,7 @@
354359
55950C5A291DAC8400F1CAD8 /* SendBatteryInfo.swift in Sources */,
355360
55B4E8EA2931742300492C77 /* EmbedStructs.swift in Sources */,
356361
553CD2B42AF65288006D3402 /* MenuBarExtraView.swift in Sources */,
362+
55CE77562B0586390094B98D /* SettingsViewmacOS.swift in Sources */,
357363
550348DD291DA3BC006551B0 /* HomeUIView.swift in Sources */,
358364
55A9E5332AF7669F0091D1A6 /* HelpView.swift in Sources */,
359365
55A9E53A2AF7739D0091D1A6 /* WhatIsAWebhook.swift in Sources */,

dcbattwebhook-swift/DefaultsUsed.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ selectedServiceType + "WebhookUserPfpUrl"
4343
- Date, stores a date to be used for other stuff
4444
- AutomationSavedDate
4545
- Date, stores a date for use with automation actions (comparisons and etc)
46+
- showMenuBarExtra
47+
- Bool, stores whether the user has chosen to show or hide the menu bar extra (true by default)
48+
- hideMainWindow
49+
- Bool, stores whether the user has chosen to hide or show the main window and dock icon (false by default)
4650
- IsFirstLaunch
4751
- Bool, set to true after the first time the app is launched.
4852
- Will be reset to false if UserDefaults are cleared

dcbattwebhook-swift/dcbattwebhook_swiftApp.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import WatchConnectivity
1313
/// Name of the app
1414
public let prodName = "Battery Webhook"
1515
/// Base version of the app, use `version` if you want the running OS as well
16-
public let versionBase = "1.0b43"
16+
public let versionBase = "1.0b44"
1717

1818
#if os(macOS)
1919
public let version = "\(versionBase) on macOS"
@@ -51,16 +51,14 @@ struct dcbattwebhook_swiftApp: App {
5151
var body: some Scene {
5252
WindowGroup {
5353
ContentView()
54-
#if os(macOS)
55-
.frame(minWidth: 600, maxWidth: 1000, minHeight: 300, maxHeight: 500)
56-
#endif
57-
.onAppear {
5854
#if os(macOS)
59-
NSWindow.allowsAutomaticWindowTabbing = false
60-
if (!hideMainWindow) {let _ = NSApplication.shared.setActivationPolicy(.regular)}
61-
else {let _ = NSApplication.shared.setActivationPolicy(.accessory)}
55+
.frame(minWidth: 600, maxWidth: 1000, minHeight: 300, maxHeight: 500)
56+
.onAppear {
57+
NSWindow.allowsAutomaticWindowTabbing = false
58+
if (!hideMainWindow) {let _ = NSApplication.shared.setActivationPolicy(.regular)}
59+
else {let _ = NSApplication.shared.setActivationPolicy(.accessory)}
60+
}
6261
#endif
63-
}
6462
}
6563
#if os(macOS)
6664
.windowResizability(.contentSize)

0 commit comments

Comments
 (0)