secretive/Secretive/Controllers/LaunchAgentController.swift

16 lines
329 B
Swift
Raw Normal View History

2020-04-04 22:16:31 +00:00
import Foundation
import ServiceManagement
struct LaunchAgentController {
func install() -> Bool {
_ = setEnabled(false)
2020-09-22 06:12:50 +00:00
return setEnabled(true)
2020-04-04 22:16:31 +00:00
}
private func setEnabled(_ enabled: Bool) -> Bool {
SMLoginItemSetEnabled("com.maxgoedjen.Secretive.SecretAgent" as CFString, enabled)
}
}