Skip to content

Commit

Permalink
added launch at login capability
Browse files Browse the repository at this point in the history
  • Loading branch information
antingle committed May 6, 2022
1 parent 6136d86 commit 2cf39cc
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
43 changes: 41 additions & 2 deletions Calculator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
92AA9002281EEBEA008C9EC8 /* HistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AA9001281EEBEA008C9EC8 /* HistoryView.swift */; };
92AA9004281F802C008C9EC8 /* History.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AA9003281F802C008C9EC8 /* History.swift */; };
92B01F4D280942500069F3D7 /* Expression in Frameworks */ = {isa = PBXBuildFile; productRef = 92B01F4C280942500069F3D7 /* Expression */; };
92EEDD392825998A005F0CD8 /* LaunchAtLogin in Frameworks */ = {isa = PBXBuildFile; productRef = 92EEDD382825998A005F0CD8 /* LaunchAtLogin */; };
92F4476C28089FEE00EC45D5 /* CalculatorApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F4476B28089FEE00EC45D5 /* CalculatorApp.swift */; };
92F4476E28089FEE00EC45D5 /* PopoverView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F4476D28089FEE00EC45D5 /* PopoverView.swift */; };
92F4477028089FF100EC45D5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 92F4476F28089FF100EC45D5 /* Assets.xcassets */; };
Expand Down Expand Up @@ -52,6 +53,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
92EEDD392825998A005F0CD8 /* LaunchAtLogin in Frameworks */,
92B01F4D280942500069F3D7 /* Expression in Frameworks */,
9298D4AB2825055200EC852D /* KeyboardShortcuts in Frameworks */,
);
Expand Down Expand Up @@ -142,6 +144,7 @@
92F4476428089FEE00EC45D5 /* Sources */,
92F4476528089FEE00EC45D5 /* Frameworks */,
92F4476628089FEE00EC45D5 /* Resources */,
92EEDD3A28259B40005F0CD8 /* Copy “Launch at Login Helper” */,
);
buildRules = (
);
Expand All @@ -151,6 +154,7 @@
packageProductDependencies = (
92B01F4C280942500069F3D7 /* Expression */,
9298D4AA2825055200EC852D /* KeyboardShortcuts */,
92EEDD382825998A005F0CD8 /* LaunchAtLogin */,
);
productName = Calculator;
productReference = 92F4476828089FEE00EC45D5 /* Calculator.app */;
Expand Down Expand Up @@ -183,6 +187,7 @@
packageReferences = (
92B01F4B280942500069F3D7 /* XCRemoteSwiftPackageReference "Expression" */,
9298D4A92825055200EC852D /* XCRemoteSwiftPackageReference "KeyboardShortcuts" */,
92EEDD372825998A005F0CD8 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */,
);
productRefGroup = 92F4476928089FEE00EC45D5 /* Products */;
projectDirPath = "";
Expand All @@ -205,6 +210,27 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
92EEDD3A28259B40005F0CD8 /* Copy “Launch at Login Helper” */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Copy “Launch at Login Helper”";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${BUILT_PRODUCTS_DIR}/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
92F4476428089FEE00EC45D5 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -357,7 +383,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Calculator/Preview Content\"";
DEVELOPMENT_TEAM = 4UQS8N4WUS;
ENABLE_HARDENED_RUNTIME = NO;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Calculator/Info.plist;
Expand Down Expand Up @@ -387,7 +413,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Calculator/Preview Content\"";
DEVELOPMENT_TEAM = 4UQS8N4WUS;
ENABLE_HARDENED_RUNTIME = NO;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Calculator/Info.plist;
Expand Down Expand Up @@ -445,6 +471,14 @@
minimumVersion = 0.9.3;
};
};
92EEDD372825998A005F0CD8 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/LaunchAtLogin";
requirement = {
branch = main;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
Expand All @@ -458,6 +492,11 @@
package = 92B01F4B280942500069F3D7 /* XCRemoteSwiftPackageReference "Expression" */;
productName = Expression;
};
92EEDD382825998A005F0CD8 /* LaunchAtLogin */ = {
isa = XCSwiftPackageProductDependency;
package = 92EEDD372825998A005F0CD8 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */;
productName = LaunchAtLogin;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 92F4476028089FEE00EC45D5 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
"branch" : "main",
"revision" : "5e453238c13a42a3448f1effc53c4a7a4cd22c15"
}
},
{
"identity" : "launchatlogin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sindresorhus/LaunchAtLogin",
"state" : {
"branch" : "main",
"revision" : "e8171b3e38a2816f579f58f3dac1522aa39efe41"
}
}
],
"version" : 2
Expand Down
8 changes: 7 additions & 1 deletion Calculator/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@
import SwiftUI
import AudioToolbox
import KeyboardShortcuts
import LaunchAtLogin

struct SettingsView: View {
@EnvironmentObject private var historyStore: HistoryStore
@AppStorage("showingButtons") private var showingButtons = true

var body: some View {
VStack(alignment: .leading, spacing: 10) {

// MARK: - Display and Change Global Shortcut
KeyboardShortcuts.Recorder(for: .togglePopover)

// MARK: - Toggle Buttons
// MARK: - Toggle Launch at Login
LaunchAtLogin.Toggle()

// MARK: - Toggle Button View
Toggle(isOn: $showingButtons, label: {
Text("Show Buttons").padding(.leading, 4)
})
Expand Down

0 comments on commit 2cf39cc

Please sign in to comment.