diff --git a/Example/Sources/Example/main.swift b/Example/Sources/Example/main.swift index 42a20be..6ae50ad 100644 --- a/Example/Sources/Example/main.swift +++ b/Example/Sources/Example/main.swift @@ -27,7 +27,8 @@ aperture.onFinish = { aperture.start() -print("Recording the screen for 5 seconds") +print("Available screens:", Aperture.Devices.screen().map(\.name).joined(separator: ", ")) +print("Recording screen for 5 seconds") delay(seconds: 5) { aperture.stop() diff --git a/Sources/Aperture/Utilities.swift b/Sources/Aperture/Utilities.swift index 0c59475..4e9a84f 100644 --- a/Sources/Aperture/Utilities.swift +++ b/Sources/Aperture/Utilities.swift @@ -62,6 +62,10 @@ extension NSScreen { // TODO: Use the built-in `.localizedName` property instead when targeting macOS 10.15. I can then drop this and `infoForCGDisplay`. var name: String { + if #available(macOS 10.15, *) { + return localizedName + } + guard let info = infoForCGDisplay(id, options: kIODisplayOnlyPreferredName) else { return "Unknown screen" }