Skip to content

Instantly share code, notes, and snippets.

@Nodirbek-Sharipov
Last active January 28, 2020 21:11
Show Gist options
  • Save Nodirbek-Sharipov/c40cc898635d4754ccde9714d7939315 to your computer and use it in GitHub Desktop.
Save Nodirbek-Sharipov/c40cc898635d4754ccde9714d7939315 to your computer and use it in GitHub Desktop.

Auto run iTunes-Sniper (by Wes Bos) upon system startup in mac OS

cd ~/Library/LaunchAgents

touch com.spotify.daemon.plist

vi com.spotify.daemon.plist

customize & insert following & save and exit vim

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>Label</key>
		<string>com.spotify.daemon.plist</string>
		
		<key>RunAtLoad</key>
		<true/>
		
		<key>StandardErrorPath</key>
		<string>/Users/raresoft/Documents/spotifyErr.log</string>
		
		<key>StandardOutPath</key>
		<string>/Users/raresoft/Documents/spotify.log</string>
		
		<key>EnvironmentVariables</key>
		<dict>
			<key>PATH</key>
			<string><![CDATA[/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin]]></string>
		</dict>
		<key>WorkingDirectory</key>
		<string>/Users/raresoft/Documents/</string>
		
		<key>ProgramArguments</key>
		<array>
			<string>/usr/local/bin/node</string>
			<string>spotify.js</string>
		</array>
	</dict>
</plist>

<string> under the <key>WorkingDirectory</key> specifies the directory to JS script to be run spotify.js in this case is the script to be run on startup

ENJOY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment