Skip to content

Instantly share code, notes, and snippets.

@lexicalunit
Created February 23, 2021 21:51
Show Gist options
  • Save lexicalunit/ba2c880f692b5d0bad716b2d7e8c222d to your computer and use it in GitHub Desktop.
Save lexicalunit/ba2c880f692b5d0bad716b2d7e8c222d to your computer and use it in GitHub Desktop.
Installs our meeting_detector script as a macOS LaunchAgent.
#!/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" <<EOF
<?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.lexicalunit.meeting_detector</string>
<key>UserName</key>
<string>$USER</string>
<key>ProgramArguments</key>
<array>
<string>$HOME/bin/meeting_detector</string>
</array>
<key>Nice</key>
<integer>1</integer>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/meeting_detector.err</string>
<key>StandardOutPath</key>
<string>/tmp/meeting_detector.out</string>
</dict>
</plist>
EOF
launchctl load "$AGENT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment