mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Working Indicators
This commit is contained in:
parent
79eb1311bf
commit
1a45d4e7f4
16 changed files with 629 additions and 17 deletions
15
DynamicIsland/helpers/AppleScriptError.swift
Normal file
15
DynamicIsland/helpers/AppleScriptError.swift
Normal 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
|
||||
}
|
||||
28
DynamicIsland/helpers/AppleScriptRunner.swift
Normal file
28
DynamicIsland/helpers/AppleScriptRunner.swift
Normal 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
|
||||
}
|
||||
}
|
||||
22
DynamicIsland/helpers/SensorError.swift
Normal file
22
DynamicIsland/helpers/SensorError.swift
Normal 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
|
||||
}
|
||||
}
|
||||
15
DynamicIsland/helpers/SensorMethod.swift
Normal file
15
DynamicIsland/helpers/SensorMethod.swift
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue