Skip to content

Commit

Permalink
Add Launch at login option
Browse files Browse the repository at this point in the history
  • Loading branch information
streetturtle committed Jul 1, 2023
1 parent ce9636c commit 890b44c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 5 deletions.
48 changes: 44 additions & 4 deletions pullBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
7629FBD02A4F713300081779 /* LaunchAtLogin in Frameworks */ = {isa = PBXBuildFile; productRef = 7629FBCF2A4F713300081779 /* LaunchAtLogin */; };
768A4C5528AF253C004E557E /* BottomItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 768A4C5428AF253C004E557E /* BottomItemView.swift */; };
769F4E1B2765A2B900594911 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769F4E1A2765A2B900594911 /* AboutView.swift */; };
769F4E7B277B97B300594911 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769F4E7A277B97B300594911 /* Notifications.swift */; };
Expand Down Expand Up @@ -56,6 +57,7 @@
files = (
8CECBBF82742ABDA00A2802D /* Defaults in Frameworks */,
8CECBBFB2742ABE600A2802D /* Alamofire in Frameworks */,
7629FBD02A4F713300081779 /* LaunchAtLogin in Frameworks */,
76D5F9E428D28958009EBD80 /* KeychainAccess in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -137,6 +139,7 @@
8CECBBDB2742AAF800A2802D /* Sources */,
8CECBBDC2742AAF800A2802D /* Frameworks */,
8CECBBDD2742AAF800A2802D /* Resources */,
7629FBD12A4F7AB700081779 /* Copy “Launch at Login Helper” */,
);
buildRules = (
);
Expand All @@ -147,6 +150,7 @@
8CECBBF72742ABDA00A2802D /* Defaults */,
8CECBBFA2742ABE600A2802D /* Alamofire */,
76D5F9E328D28958009EBD80 /* KeychainAccess */,
7629FBCF2A4F713300081779 /* LaunchAtLogin */,
);
productName = pullBar;
productReference = 8CECBBDF2742AAF800A2802D /* pullBar.app */;
Expand Down Expand Up @@ -180,6 +184,7 @@
8CECBBF62742ABDA00A2802D /* XCRemoteSwiftPackageReference "Defaults" */,
8CECBBF92742ABE600A2802D /* XCRemoteSwiftPackageReference "Alamofire" */,
76D5F9E228D28958009EBD80 /* XCRemoteSwiftPackageReference "KeychainAccess" */,
7629FBCE2A4F713300081779 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */,
);
productRefGroup = 8CECBBE02742AAF800A2802D /* Products */;
projectDirPath = "";
Expand All @@ -202,6 +207,28 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
7629FBD12A4F7AB700081779 /* Copy “Launch at Login Helper” */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Copy “Launch at Login Helper”";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${BUILT_PRODUCTS_DIR}/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
8CECBBDB2742AAF800A2802D /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -362,7 +389,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = UV3HUS49VJ;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -374,7 +401,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.6;
MARKETING_VERSION = 1.7;
PRODUCT_BUNDLE_IDENTIFIER = debug.com.pavelmakhov.pullBar;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -391,7 +418,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = UV3HUS49VJ;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -403,7 +430,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.6;
MARKETING_VERSION = 1.7;
PRODUCT_BUNDLE_IDENTIFIER = com.pavelmakhov.pullBar;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -435,6 +462,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
7629FBCE2A4F713300081779 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/LaunchAtLogin";
requirement = {
branch = main;
kind = branch;
};
};
76D5F9E228D28958009EBD80 /* XCRemoteSwiftPackageReference "KeychainAccess" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess";
Expand Down Expand Up @@ -462,6 +497,11 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
7629FBCF2A4F713300081779 /* LaunchAtLogin */ = {
isa = XCSwiftPackageProductDependency;
package = 7629FBCE2A4F713300081779 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */;
productName = LaunchAtLogin;
};
76D5F9E328D28958009EBD80 /* KeychainAccess */ = {
isa = XCSwiftPackageProductDependency;
package = 76D5F9E228D28958009EBD80 /* XCRemoteSwiftPackageReference "KeychainAccess" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
"revision" : "84e546727d66f1adc5439debad16270d0fdd04e7",
"version" : "4.2.2"
}
},
{
"identity" : "launchatlogin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sindresorhus/LaunchAtLogin",
"state" : {
"branch" : "main",
"revision" : "7ad6331f9c38953eb1ce8737758e18f7607e984a"
}
}
],
"version" : 2
Expand Down
11 changes: 10 additions & 1 deletion pullBar/Views/PreferencesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import SwiftUI
import Defaults
import KeychainAccess
import LaunchAtLogin

struct PreferencesView: View {

Expand All @@ -27,7 +28,8 @@ struct PreferencesView: View {
@State private var showGhAlert = false

@StateObject private var githubTokenValidator = GithubTokenValidator()

@ObservedObject private var launchAtLogin = LaunchAtLogin.observable

var body: some View {
Form {
Section {
Expand Down Expand Up @@ -134,6 +136,13 @@ struct PreferencesView: View {
.pickerStyle(MenuPickerStyle())
.frame(width: 100)
}

HStack(alignment: .center) {
Text("Launch at login:").frame(width: 120, alignment: .trailing)
Toggle("", isOn: $launchAtLogin.isEnabled)

}

}
}
.padding()
Expand Down

0 comments on commit 890b44c

Please sign in to comment.