secretive/Secretive/Controllers/LaunchAgentController.swift
2020-09-21 23:12:50 -07:00

16 lines
329 B
Swift

import Foundation
import ServiceManagement
struct LaunchAgentController {
func install() -> Bool {
_ = setEnabled(false)
return setEnabled(true)
}
private func setEnabled(_ enabled: Bool) -> Bool {
SMLoginItemSetEnabled("com.maxgoedjen.Secretive.SecretAgent" as CFString, enabled)
}
}