{"id":19035792,"url":"https://github.com/chrenn/loginitemkit","last_synced_at":"2025-10-16T19:34:42.800Z","repository":{"id":39962888,"uuid":"244391322","full_name":"chrenn/LoginItemKit","owner":"chrenn","description":"Add non-sandboxed macOS applications to user login items","archived":false,"fork":false,"pushed_at":"2023-01-09T14:01:07.000Z","size":352,"stargazers_count":32,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T19:03:48.205Z","etag":null,"topics":["launchatlogin","macos","swift-package"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrenn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-02T14:28:00.000Z","updated_at":"2025-01-14T01:53:44.000Z","dependencies_parsed_at":"2023-02-08T12:15:47.091Z","dependency_job_id":null,"html_url":"https://github.com/chrenn/LoginItemKit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/chrenn/LoginItemKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrenn%2FLoginItemKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrenn%2FLoginItemKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrenn%2FLoginItemKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrenn%2FLoginItemKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrenn","download_url":"https://codeload.github.com/chrenn/LoginItemKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrenn%2FLoginItemKit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260308438,"owners_count":22989812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["launchatlogin","macos","swift-package"],"created_at":"2024-11-08T21:52:08.580Z","updated_at":"2025-10-16T19:34:42.727Z","avatar_url":"https://github.com/chrenn.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoginItemKit\n\n\u003e **Warning**  \n\u003e With macOS 13, Apple introduced [SMAppService](https://developer.apple.com/documentation/servicemanagement/smappservice) and deprecated the _Hide_ property.  \n\u003e Please use SMAppService or a wrapper like [LaunchAtLogin-Modern](https://github.com/sindresorhus/LaunchAtLogin-Modern) for new projects.\n\nA simple Swift package to add non-sandboxed macOS applications to user login items and to control their _Hide_ property.\n\n\u003cimg width=\"400\" src=\"./Media/Screenshot.png\" alt=\"Screenshot\"\u003e\n\n## Overview\n\nThere are basically two ways to achieve _Launch at Login_ functionality on macOS.\n\nLet's compare LoginItemKit to the popular [LaunchAtLogin](https://github.com/sindresorhus/LaunchAtLogin) package.\n\n| []()                            | LaunchAtLogin                                                                                                  | LoginItemKit                                                                                                |\n| :------------------------------ | :------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------- |\n| Framework                       | [ServiceManagement](https://developer.apple.com/documentation/servicemanagement/1501557-smloginitemsetenabled) | [LaunchServices](https://developer.apple.com/documentation/coreservices/klssharedfilelistsessionloginitems) |\n| Deprecated                      | [Partly](https://developer.apple.com/documentation/servicemanagement/1431086-smcopyalljobdictionaries) (10.10) | [Yes](https://developer.apple.com/documentation/coreservices/klssharedfilelistsessionloginitems) (10.11)    |\n| Sandbox support                 | Yes                                                                                                            |  No                                                                                                         |\n| SwiftPM support                 | [Yes](https://github.com/sindresorhus/LaunchAtLogin/issues/4)                                                  | Yes                                                                                                         |\n| Needs helper app \u0026 build script | Yes                                                                                                            | No                                                                                                          |\n| Shows up in system preferences  | [No](https://stackoverflow.com/a/15104481)                                                                     | Yes                                                                                                         |\n\nSo 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.\n\n### The _Hide_ checkbox\n\nChecking _Hide_ can cause problems for applications using high values for `NSWindow.Level`, e.g. the tooltip windows in [Swish](https://highlyopinionated.co/swish/). Version 2 of LoginItemKit allows you to read and write this property.\n\n## Installation\n\n#### SwiftPM\n\n```swift\n.package(url: \"https://github.com/chrenn/LoginItemKit\", from: \"2.0.0\")\n```\n\n## API\n\nLoginItemKit exposes a tertiary `.launchState` enum for granular control as well as a simple `.launchAtLogin` boolean.\n\n| []()                              | `launchState` | `launchAtLogin { get, set }` |\n| :-------------------------------- | :------------ | :--------------------------- |\n| Not in Login Items                | `.none`       | `false`, `false`             |\n| In Login Items \u0026 _Hide_ checked   | `.hide`       | `true`, -                    |\n| In Login Items \u0026 _Hide_ unchecked | `.show`       | `true`, `true`               |\n\n### Usage\n\n```swift\nimport LoginItemKit\n\nprint(LoginItemKit.launchState, LoginItemKit.launchAtLogin)\n// → .none, false\n\nLoginItemKit.launchAtLogin = true\n\nprint(LoginItemKit.launchState, LoginItemKit.launchAtLogin)\n// → .show, true\n\nLoginItemKit.launchState = .hide\n\nprint(LoginItemKit.launchState, LoginItemKit.launchAtLogin)\n// → .hide, true\n\n```\n\n## Resources\n\n- [LaunchAtLogin](https://github.com/sindresorhus/LaunchAtLogin)\n- [LoginServiceKit](https://github.com/Clipy/LoginServiceKit)\n- [HWSensors3](https://sourceforge.net/p/hwsensors/hwsensors3/code3/107/tree/trunk/hwmonitor2/HWMonitorSMC/RunAtLogin.swift#l4)\n- [Marcos Crispino](https://stackoverflow.com/a/5598992)\n\n## Used by\n\n- [Swish](https://highlyopinionated.co/swish/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrenn%2Floginitemkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrenn%2Floginitemkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrenn%2Floginitemkit/lists"}