title: Enable Zettelstore to start automatically on macOS role: manual tags: #installation #manual #zettelstore syntax: zmk back: 00001003300000 backward: 00001003300000 box-number: 1 copyright: (c) 2020-present by Detlef Stern created: 20220114181521 forward: 00001003310104 00001003310106 00001003310108 00001003310110 00001004010000 lang: en license: EUPL-1.2-or-later modified: 20220119124635 published: 20220119124635 visibility: public There are several ways to automatically start Zettelstore. * [[Login Items|#login-items]] * [[Launch Agent|#launch-agent]] === Login Items Via macOS's system preferences, everybody is able to specify executables that are started when a user is logged in. To do this, start system preferences and select ""Users & Groups"". {{Zettel without title: 00001003310104|00001003310104}} In the next screen, select the current user and then click on ""Login Items"". {{Zettel without title: 00001003310106|00001003310106}} Click on the plus sign at the bottom and select the Zettelstore executable. {{Zettel without title: 00001003310108|00001003310108}} Optionally select the ""Hide"" check box. {{Zettel without title: 00001003310110|00001003310110}} The next time you log into your macOS computer, Zettelstore will be started automatically. Unfortunately, hiding the Zettelstore windows does not always work. Therefore, this method is just a way to automate navigating to the directory where the Zettelstore executable is placed and to click on that icon. If you don't want the Zettelstore window, you should try the next method. === Launch Agent If you want to execute Zettelstore automatically and less visible, and if you know a little bit about working in the terminal application, then you could try to run Zettelstore under the control of the [[Launchd system|https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/Introduction.html]]. First, you have to create a description for ""Launchd"". This is a text file named ''zettelstore.plist'' with the following content. It assumes that you have copied the Zettelstore executable in a local folder called ''~/bin'' and have created a file for [[startup configuration|00001004010000]] called ''zettelstore.cfg'', which is placed in the same folder[^If you are not using a configuration file, just remove the lines ``-c`` and ``/Users/USERNAME/bin/zettelstore.cfg``.]: ``` Label de.zettelstore ProgramArguments /Users/USERNAME/bin/zettelstore run -c /Users/USERNAME/bin/zettelstore.cfg WorkingDirectory /Users/USERNAME EnvironmentVariables HOME /Users/USERNAME KeepAlive LowPriorityIO ProcessType Background StandardOutPath /Users/USERNAME/Library/Logs/Zettelstore.log StandardErrorPath /Users/USERNAME/Library/Logs/Zettelstore-Errors.log ``` You must substitute all occurrences of ''USERNAME'' with your user name. Place this file into the user specific folder ''~/Library/LaunchAgents''. Log out and in again, or execute the command ``launchctl load ~/Library/LaunchAgents/zettelstore.plist``.