LoginItemKit

1.0.2

Add non-sandboxed macOS applications to user login items
chrenn/LoginItemKit

What's New

1.0.2

2020-12-31T18:53:18Z
  • Fixed a crash on Apple Silicon.

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

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 06 2023 22:09:03 GMT-0900 (Hawaii-Aleutian Daylight Time)