#!/bin/bash set -e # The meeting_detector script: https://gist.github.com/lexicalunit/ff7bb0981cb92ee5ce1cac6f83e1c248 AGENT="$HOME/Library/LaunchAgents/com.lexicalunit.meeting_detector.plist" cat >"$AGENT" < Label com.lexicalunit.meeting_detector UserName $USER ProgramArguments $HOME/bin/meeting_detector Nice 1 KeepAlive RunAtLoad StandardErrorPath /tmp/meeting_detector.err StandardOutPath /tmp/meeting_detector.out EOF launchctl load "$AGENT"