Working Indicators

This commit is contained in:
Hariharan Mudaliar 2025-09-06 19:28:38 +05:30
commit 1a45d4e7f4
16 changed files with 629 additions and 17 deletions

View file

@ -0,0 +1,15 @@
//
// AppleScriptError.swift
// DynamicIsland
//
// Adapted from TheBoringWorker-HUD
// Created by GitHub Copilot on 06/09/25.
//
import Foundation
enum AppleScriptError: Error {
case initScriptFailed
case runtimeError
case emptyOutput
}

View file

@ -0,0 +1,28 @@
//
// AppleScriptRunner.swift
// DynamicIsland
//
// Adapted from TheBoringWorker-HUD
// Created by GitHub Copilot on 06/09/25.
//
import Foundation
class AppleScriptRunner {
private init() {}
static func run(script: String) throws -> String {
var error: NSDictionary?
if let scriptObject = NSAppleScript(source: script) {
let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError(&error)
guard error == nil else {
throw AppleScriptError.runtimeError
}
if let outputString = output.stringValue {
return outputString
}
throw AppleScriptError.emptyOutput
}
throw AppleScriptError.initScriptFailed
}
}

View file

@ -0,0 +1,22 @@
//
// SensorError.swift
// DynamicIsland
//
// Adapted from TheBoringWorker-HUD
// Created by GitHub Copilot on 06/09/25.
//
import Foundation
enum SensorError: Error {
enum Display: Error {
case notFound
case notSilicon
case notStandard
}
enum Keyboard: Error {
case notFound
case notSilicon
case notStandard
}
}

View file

@ -0,0 +1,15 @@
//
// SensorMethod.swift
// DynamicIsland
//
// Adapted from TheBoringWorker-HUD
// Created by GitHub Copilot on 06/09/25.
//
import Foundation
enum SensorMethod {
case standard
case m1
case allFailed
}