Project

General

Profile

Autostart Core on Mac » History » Version 2

m4yer, 06/06/2010 12:06 AM

1 1 m4yer
h1. Autostart Core on Mac
2 1 m4yer
3 1 m4yer
The best way to autostart a script on Mac, is to use the default autostart deamon: *launchd*
4 1 m4yer
5 1 m4yer
First you need to make a property list file (plist), which launchd can load.
6 1 m4yer
7 1 m4yer
Here's an example plist (by e-jat)
8 1 m4yer
@<?xml version="1.0" encoding="UTF-8"?>
9 1 m4yer
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
10 1 m4yer
<plist version="1.0">
11 1 m4yer
<dict>
12 1 m4yer
	<key>Label</key>
13 1 m4yer
	<string>com.quasselcore.daemon</string>
14 1 m4yer
	<key>ProgramArguments</key>
15 1 m4yer
	<array>
16 1 m4yer
		<string>/Applications/Quassel/quasselcore</string>
17 1 m4yer
	</array>
18 1 m4yer
	<key>RunAtLoad</key>
19 1 m4yer
	<true/>
20 1 m4yer
	<key>WorkingDirectory</key>
21 1 m4yer
	<string>/Applications/Quassel</string>
22 1 m4yer
</dict>
23 1 m4yer
</plist>@
24 1 m4yer
25 1 m4yer
26 1 m4yer
Save this file in ~/Library/LaunchAgents/org.quassel-irg.quasselcore.plist, then go into Terminal and, in your home directory, run:
27 1 m4yer
28 1 m4yer
@launchctl load Library/LaunchAgents/com.apple.TextEdit.plist@
29 1 m4yer
30 2 m4yer
quasselcore should now run and start automatically at boot.