Skip to content

Instantly share code, notes, and snippets.

@supercoffee
Last active June 14, 2016 16:11
Show Gist options
  • Save supercoffee/c29e4fba08b96710257f1985d13f5b58 to your computer and use it in GitHub Desktop.
Save supercoffee/c29e4fba08b96710257f1985d13f5b58 to your computer and use it in GitHub Desktop.
Run a shell script to start vagrant VMs at login

How to use

Download com.bendaschel.onlogin.plist.

In a terminal, type the following commands

cp com.bendaschel.vagrantup.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/com.bendaschel.onlogin.plist

touch ~/.scripts/onlogin
# Add whatever shell commands you want to the onlogin script

chmod +x ~/.scripts/onlogin

launchctl start com.bendaschel.onlogin
<?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.bendaschel.onlogin</string>
<key>Program</key>
<string>~/.scripts/onlogin</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment