mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
Five tracked macOS IME specs ran `swift .tmp/select-input-source.swift`, a file that is gitignored and existed only on one machine. Anyone else checking out the repo — or the same machine after .tmp is cleaned — could not run them, and they are the capture drivers for the macOS rows that are blocked waiting for exactly those runs. Moves it to tests/e2e/ beside its callers. The chord spec now resolves it from __dirname rather than reaching two levels up into .tmp.
15 lines
405 B
Swift
15 lines
405 B
Swift
import Carbon
|
|
|
|
guard CommandLine.arguments.count == 2 else {
|
|
exit(2)
|
|
}
|
|
|
|
let properties = [kTISPropertyInputSourceID: CommandLine.arguments[1] as CFString] as CFDictionary
|
|
let sources = TISCreateInputSourceList(properties, true).takeRetainedValue() as! [TISInputSource]
|
|
guard let source = sources.first else {
|
|
exit(3)
|
|
}
|
|
|
|
TISEnableInputSource(source)
|
|
exit(TISSelectInputSource(source) == noErr ? 0 : 4)
|