mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-15 10:15:32 +01:00
97ccb4840a
Agent application (macOS 10.11+). More info at https://www.insanelymac.com/forum/topic/341047-cloverapp-testing/
25 lines
625 B
Swift
25 lines
625 B
Swift
//
|
|
// RunAtLogin.swift
|
|
// HWMonitorSMC
|
|
//
|
|
// Created by vector sigma on 18/03/18.
|
|
// Copyright © 2018 HWSensor. All rights reserved.
|
|
//
|
|
|
|
import Cocoa
|
|
import ServiceManagement
|
|
|
|
extension AppDelegate {
|
|
func setLaunchAtStartup() {
|
|
let success : Bool = SMLoginItemSetEnabled(gHelperID, true)
|
|
UserDefaults.standard.set(success, forKey: kRunAtLogin)
|
|
UserDefaults.standard.synchronize()
|
|
}
|
|
|
|
func removeLaunchAtStartup() {
|
|
let success : Bool = SMLoginItemSetEnabled(gHelperID, false)
|
|
UserDefaults.standard.set(success ? false : true, forKey: kRunAtLogin)
|
|
UserDefaults.standard.synchronize()
|
|
}
|
|
}
|