Add launchd LaunchAgent support

This commit is contained in:
2013-05-11 00:09:49 +01:00
parent 1d95f8d632
commit 99634840a8
2 changed files with 50 additions and 6 deletions

View File

@@ -53,6 +53,12 @@ install_virtualenv () {
curl -s https://raw.github.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | bash
}
install_launch_agents () {
for file in $ROOT_PATH/launch_agents/*.plist; do
symlink "$file" "$HOME/Library/LaunchAgents/$(basename "$file")"
done
}
#
# Initial Setup
@@ -110,6 +116,9 @@ case "$1" in
virtualenv|venv)
install_virtualenv
;;
launch_agents|agents)
install_launch_agents
;;
info)
echo "Target directory: $TARGET"
echo "Detected dotfiles root: $ROOT_PATH"
@@ -118,13 +127,14 @@ case "$1" in
echo 'usage: ./install.sh [command]'
echo ''
echo 'Available commands:'
echo ' info: Target and source directory info.'
echo ' symlinks: Install symlinks for various dotfiles into' \
echo ' info: Target and source directory info.'
echo ' symlinks: Install symlinks for various dotfiles into' \
'target directory.'
echo ' homebrew: Install Homebrew (Mac OS X only).'
echo ' rbenv: Install rbenv, a Ruby version manager.'
echo ' nvm: Install nvm, a Node.js version manager.'
echo ' virtualenv: Install virtualenv-burrito, a Python version and' \
echo ' homebrew: Install Homebrew (Mac OS X only).'
echo ' rbenv: Install rbenv, a Ruby version manager.'
echo ' nvm: Install nvm, a Node.js version manager.'
echo ' virtualenv: Install virtualenv-burrito, a Python version and' \
'environment manager.'
echo ' launch_agents: Install launchd plists to ~/Library/LaunchAgents/'
;;
esac

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>me.jimeh.logrotate</string>
<key>ProgramArguments</key>
<array>
<string>~/.dotfiles/bin/logrotate-ex</string>
</array>
<key>EnableGlobbing</key>
<true/>
<!--
<key>StandardOutPath</key>
<string>~/Library/Logs/logrotate-ex.log</string>
<key>StandardErrorPath</key>
<string>~/Library/Logs/logrotate-ex.error.log</string>
-->
<key>RunAtLoad</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin</string>
</dict>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>25</integer>
</dict>
</dict>
</plist>