Skip to content

Commit c04fad4

Browse files
committed
Alert sound can accept paths
1 parent ce36527 commit c04fad4

File tree

4 files changed

+43
-10
lines changed

4 files changed

+43
-10
lines changed

IsThereNet.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
CODE_SIGN_ENTITLEMENTS = IsThereNet/IsThereNet.entitlements;
313313
CODE_SIGN_STYLE = Automatic;
314314
COMBINE_HIDPI_IMAGES = YES;
315-
CURRENT_PROJECT_VERSION = 1.6;
315+
CURRENT_PROJECT_VERSION = 1.6.1;
316316
DEAD_CODE_STRIPPING = YES;
317317
DEVELOPMENT_ASSET_PATHS = "\"IsThereNet/Preview Content\"";
318318
DEVELOPMENT_TEAM = RDDXV84A73;
@@ -330,7 +330,7 @@
330330
"@executable_path/../Frameworks",
331331
);
332332
MACOSX_DEPLOYMENT_TARGET = 11.0;
333-
MARKETING_VERSION = 1.6;
333+
MARKETING_VERSION = 1.6.1;
334334
PRODUCT_BUNDLE_IDENTIFIER = com.lowtechguys.IsThereNet;
335335
PRODUCT_NAME = "$(TARGET_NAME)";
336336
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -346,7 +346,7 @@
346346
CODE_SIGN_ENTITLEMENTS = IsThereNet/IsThereNet.entitlements;
347347
CODE_SIGN_STYLE = Automatic;
348348
COMBINE_HIDPI_IMAGES = YES;
349-
CURRENT_PROJECT_VERSION = 1.6;
349+
CURRENT_PROJECT_VERSION = 1.6.1;
350350
DEAD_CODE_STRIPPING = YES;
351351
DEVELOPMENT_ASSET_PATHS = "\"IsThereNet/Preview Content\"";
352352
DEVELOPMENT_TEAM = RDDXV84A73;
@@ -364,7 +364,7 @@
364364
"@executable_path/../Frameworks",
365365
);
366366
MACOSX_DEPLOYMENT_TARGET = 11.0;
367-
MARKETING_VERSION = 1.6;
367+
MARKETING_VERSION = 1.6.1;
368368
PRODUCT_BUNDLE_IDENTIFIER = com.lowtechguys.IsThereNet;
369369
PRODUCT_NAME = "$(TARGET_NAME)";
370370
SWIFT_EMIT_LOC_STRINGS = YES;

IsThereNet/IsThereNetApp.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import Intents
1414
import Network
1515
import os.log
1616
import ServiceManagement
17-
import SwiftUI
1817
import Sparkle
18+
import SwiftUI
1919

2020
private func mainAsyncAfter(_ duration: TimeInterval, _ action: @escaping () -> Void) -> DispatchWorkItem {
2121
let workItem = DispatchWorkItem { action() }
@@ -379,13 +379,14 @@ private var pingRestartTask: DispatchWorkItem? {
379379

380380
@main
381381
struct IsThereNetApp: App {
382-
private let updaterController: SPUStandardUpdaterController
383382
init() {
384383
updaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
385384
start()
386385
}
387386

388387
var body: some Scene { Settings { EmptyView() }}
388+
389+
private let updaterController: SPUStandardUpdaterController
389390
}
390391

391392
// MARK: Constants
@@ -477,7 +478,7 @@ private struct SoundsConfig: Codable, Equatable {
477478
var slowSound: NSSound? { slow != nil ? sound(named: slow!) : nil }
478479

479480
func sound(named name: String) -> NSSound? {
480-
guard let s = NSSound(named: name) ?? NSSound(named: SONOMA_TO_ORIGINAL_SOUND_NAMES[name] ?? "") else {
481+
guard let s = NSSound(named: name) ?? NSSound(named: SONOMA_TO_ORIGINAL_SOUND_NAMES[name] ?? "") ?? NSSound(contentsOfFile: name.expandingTildeInPath, byReference: true) else {
481482
return nil
482483
}
483484

@@ -637,6 +638,12 @@ extension NSAppearance {
637638
var isDark: Bool { name == .vibrantDark || name == .darkAqua }
638639
}
639640

641+
extension String {
642+
var expandingTildeInPath: String {
643+
(self as NSString).expandingTildeInPath
644+
}
645+
}
646+
640647
// MARK: Window
641648

642649
func makeWindow(screen: NSScreen) -> NSWindow {

ReleaseNotes/1.6.1.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- Allow using any path for the alert sound, instead of just the system sounds
2+
3+
The path must be absolute, and can be pased with a tilde in place of the home directory if you want.
4+
5+
Example:
6+
7+
```json
8+
"sounds" : {
9+
"connected" : "~/Music/Chime.m4a",
10+
"volume" : 0.4
11+
}
12+
```

Releases/appcast.xml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,30 @@
22
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
33
<channel>
44
<title>IsThereNet</title>
5+
<item>
6+
<title>1.6.1</title>
7+
<pubDate>Fri, 19 Jul 2024 18:56:16 +0300</pubDate>
8+
<link>https://lowtechguys.com/istherenet</link>
9+
<sparkle:fullReleaseNotesLink>https://github.com/FuzzyIdeas/IsThereNet/releases</sparkle:fullReleaseNotesLink>
10+
<sparkle:version>1.6.1</sparkle:version>
11+
<sparkle:shortVersionString>1.6.1</sparkle:shortVersionString>
12+
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
13+
<sparkle:releaseNotesLink>https://files.lowtechguys.com/ReleaseNotes/IsThereNet-1.6.1.html</sparkle:releaseNotesLink>
14+
<enclosure url="https://files.lowtechguys.com/releases/IsThereNet-1.6.1.dmg" length="2462257" type="application/octet-stream" sparkle:edSignature="WSKM5UW1Tm8FsDTOjrokPH3SIlzxMOJI1x1vfQFYvNm1xTV8QM9TmFtw5xl46JnEmVvycp5GEWficgZplxM0Dg=="/>
15+
<sparkle:deltas>
16+
<enclosure url="https://files.lowtechguys.com/releases/IsThereNet1.6.1-1.6.delta" sparkle:deltaFrom="1.6" length="25110" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="865040" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="EiT4jO5uRD7Y6ebwR1fInYdcfqNmEmxL/tXHI8sNCFpB9Kvfd5j2nA2MfO8hQu+17S9AepIK4fLJUg0bINhZDw=="/>
17+
</sparkle:deltas>
18+
</item>
519
<item>
620
<title>1.6</title>
721
<pubDate>Thu, 18 Jul 2024 23:27:54 +0300</pubDate>
822
<link>https://lowtechguys.com/istherenet</link>
923
<sparkle:fullReleaseNotesLink>https://github.com/FuzzyIdeas/IsThereNet/releases</sparkle:fullReleaseNotesLink>
10-
<sparkle:version>10</sparkle:version>
24+
<sparkle:version>1.6</sparkle:version>
1125
<sparkle:shortVersionString>1.6</sparkle:shortVersionString>
1226
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
1327
<sparkle:releaseNotesLink>https://files.lowtechguys.com/ReleaseNotes/IsThereNet-1.6.html</sparkle:releaseNotesLink>
14-
<enclosure url="https://files.lowtechguys.com/releases/IsThereNet-1.6.dmg" length="2460917" type="application/octet-stream" sparkle:edSignature="k7tER//FCeoF66pQ2aytC6dT8/QtcsMsHBk3lnwXMJkjSFutdE4tiUnoDoPKqyR8UcrAusgAkKV3sEGwHZdCAA=="/>
28+
<enclosure url="https://files.lowtechguys.com/releases/IsThereNet-1.6.dmg" length="2462057" type="application/octet-stream" sparkle:edSignature="48P473LE2a2e5q2Davgt8TOE0HO8N/vHxgwWP9OQtL6yZ7lj5taBoDuJWP/vWxANpxtG0f1ysvJKQenIHZnEAw=="/>
1529
</item>
1630
</channel>
17-
</rss>
31+
</rss>

0 commit comments

Comments
 (0)