fixed start on boot

This commit is contained in:
Serhiy Mytrovtsiy
2019-08-19 00:07:42 +02:00
parent 8d93af8249
commit e81a5f2a27
5 changed files with 18 additions and 8 deletions

View File

@@ -343,6 +343,9 @@
9A1410F4229E721100D29793 = {
CreatedOnToolsVersion = 10.2.1;
SystemCapabilities = {
com.apple.ApplicationGroups.Mac = {
enabled = 0;
};
com.apple.Sandbox = {
enabled = 1;
};
@@ -350,6 +353,11 @@
};
9AFA401D22AE49A100FE90BC = {
CreatedOnToolsVersion = 10.2.1;
SystemCapabilities = {
com.apple.ApplicationGroups.Mac = {
enabled = 0;
};
};
};
};
};

View File

@@ -35,9 +35,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let runningApps = NSWorkspace.shared.runningApplications
let isRunning = !runningApps.filter { $0.bundleIdentifier == launcherAppId }.isEmpty
if defaults.object(forKey: "runAtLogin") != nil {
SMLoginItemSetEnabled(launcherAppId as CFString, defaults.bool(forKey: "runAtLogin"))
} else {
if defaults.object(forKey: "runAtLogin") == nil {
SMLoginItemSetEnabled(launcherAppId as CFString, true)
self.defaults.set(true, forKey: "runAtLogin")
}

View File

@@ -112,7 +112,7 @@ class MenuBar {
switch sender.title {
case "Start at login":
SMLoginItemSetEnabled(launcherId as CFString, !status)
SMLoginItemSetEnabled(launcherId as CFString, status)
self.defaults.set(status, forKey: "runAtLogin")
case "Check for updates on start":
self.defaults.set(status, forKey: "checkUpdatesOnLogin")

View File

@@ -4,6 +4,8 @@
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>

View File

@@ -2,9 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>