((META (EMPTY-STRING title "Enable Zettelstore to start automatically on macOS") (WORD role "manual") (TAG-SET tags ("#installation" "#manual" "#zettelstore")) (WORD syntax "zmk") (ZID-SET back ("00001003300000")) (ZID-SET backward ("00001003300000")) (NUMBER box-number "1") (STRING copyright "(c) 2020-present by Detlef Stern ") (TIMESTAMP created "20220114181521") (ZID-SET forward ("00001003310104" "00001003310106" "00001003310108" "00001003310110" "00001004010000")) (WORD lang "en") (EMPTY-STRING license "EUPL-1.2-or-later") (TIMESTAMP modified "20220119124635") (TIMESTAMP published "20220119124635") (WORD visibility "public")) (BLOCK (PARA (TEXT "There are several ways to automatically start Zettelstore.")) (UNORDERED (INLINE (LINK-SELF () "#login-items" (TEXT "Login Items"))) (INLINE (LINK-SELF () "#launch-agent" (TEXT "Launch Agent")))) (HEADING 1 () "login-items" "login-items" (TEXT "Login Items")) (PARA (TEXT "Via macOS's system preferences, everybody is able to specify executables that are started when a user is logged in.") (SOFT) (TEXT "To do this, start system preferences and select ") (FORMAT-QUOTE () (TEXT "Users & Groups")) (TEXT ".")) (PARA (EMBED () (ZETTEL "00001003310104") "png" (TEXT "Zettel without title: 00001003310104"))) (PARA (TEXT "In the next screen, select the current user and then click on ") (FORMAT-QUOTE () (TEXT "Login Items")) (TEXT ".")) (PARA (EMBED () (ZETTEL "00001003310106") "png" (TEXT "Zettel without title: 00001003310106"))) (PARA (TEXT "Click on the plus sign at the bottom and select the Zettelstore executable.")) (PARA (EMBED () (ZETTEL "00001003310108") "png" (TEXT "Zettel without title: 00001003310108"))) (PARA (TEXT "Optionally select the ") (FORMAT-QUOTE () (TEXT "Hide")) (TEXT " check box.")) (PARA (EMBED () (ZETTEL "00001003310110") "png" (TEXT "Zettel without title: 00001003310110"))) (PARA (TEXT "The next time you log into your macOS computer, Zettelstore will be started automatically.")) (PARA (TEXT "Unfortunately, hiding the Zettelstore windows does not always work.") (SOFT) (TEXT "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.")) (PARA (TEXT "If you don't want the Zettelstore window, you should try the next method.")) (HEADING 1 () "launch-agent" "launch-agent" (TEXT "Launch Agent")) (PARA (TEXT "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 ") (LINK-EXTERNAL () "https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/Introduction.html" (TEXT "Launchd system")) (TEXT ".")) (PARA (TEXT "First, you have to create a description for ") (FORMAT-QUOTE () (TEXT "Launchd")) (TEXT ".") (SOFT) (TEXT "This is a text file named ") (LITERAL-INPUT () "zettelstore.plist") (TEXT " with the following content.") (SOFT) (TEXT "It assumes that you have copied the Zettelstore executable in a local folder called ") (LITERAL-INPUT () "~/bin") (TEXT " and have created a file for ") (LINK-ZETTEL () "00001004010000" (TEXT "startup configuration")) (TEXT " called ") (LITERAL-INPUT () "zettelstore.cfg") (TEXT ", which is placed in the same folder") (ENDNOTE () (TEXT "If you are not using a configuration file, just remove the lines ") (LITERAL-CODE () "-c") (TEXT " and ") (LITERAL-CODE () "/Users/USERNAME/bin/zettelstore.cfg") (TEXT ".")) (TEXT ":")) (VERBATIM-CODE () "\n\n\n\t\n\t\tLabel\n\t\tde.zettelstore\n\n\t\tProgramArguments\n\t\t\n\t\t\t/Users/USERNAME/bin/zettelstore\n\t\t\trun\n\t\t\t-c\n\t\t\t/Users/USERNAME/bin/zettelstore.cfg\n\t\t\n\n\t\tWorkingDirectory\n\t\t/Users/USERNAME\n\n\t\tEnvironmentVariables\n\t\t\n\t\t\tHOME\n\t\t\t/Users/USERNAME\n\t\t\n\n\t\tKeepAlive\n\t\t\n\n\t\tLowPriorityIO\n\t\t\n\n\t\tProcessType\n\t\tBackground\n\n\t\tStandardOutPath\n\t\t/Users/USERNAME/Library/Logs/Zettelstore.log\n\n\t\tStandardErrorPath\n\t\t/Users/USERNAME/Library/Logs/Zettelstore-Errors.log\n\t\n") (PARA (TEXT "You must substitute all occurrences of ") (LITERAL-INPUT () "USERNAME") (TEXT " with your user name.")) (PARA (TEXT "Place this file into the user specific folder ") (LITERAL-INPUT () "~/Library/LaunchAgents") (TEXT ".")) (PARA (TEXT "Log out and in again, or execute the command ") (LITERAL-CODE () "launchctl load ~/Library/LaunchAgents/zettelstore.plist") (TEXT "."))))