Swiftpack.co -  chrenn/LoginItemKit as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
chrenn/LoginItemKit
Add non-sandboxed macOS applications to user login items
.package(url: "https://github.com/chrenn/LoginItemKit.git", from: "1.0.2")

LoginItemKit

A simple Swift package to add non-sandboxed macOS applications to user login items.

Screenshot

Overview

There are basically two ways to achieve launch at login functionality on macOS.

Let's compare LoginItemKit to the popular LaunchAtLogin package.

LaunchAtLogin LoginItemKit
Framework ServiceManagement LaunchServices
Deprecated Partly (10.10) Yes (10.11)
Sandbox support Yes  No
SwiftPM support No Yes
Needs helper app & build script Yes No
Shows up in system preferences No Yes

So feel free to use this package in all your non-sandboxed apps and let's hope that Apple does not remove the LaunchServices API from future versions of macOS.

Installation

SwiftPM

.package(url: "https://github.com/chrenn/LoginItemKit", from: "1.0.0")

Usage

import LoginItemKit

print(LoginItemKit.launchAtLogin)
// → false

LoginItemKit.launchAtLogin = true

print(LoginItemKit.launchAtLogin)
// → true

Inspired by

GitHub

link
Stars: 18
Last commit: 5 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

1.0.2
25 weeks ago
  • Fixed a crash on Apple Silicon.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API