Working on launch agents

This commit is contained in:
2021-12-30 17:18:10 -05:00
parent 5ba356655a
commit 1deab50401
2 changed files with 49 additions and 0 deletions

20
scripts/install_launch_agents Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
set -e
# Installs launchd agents for appropriately.
agent="$HOME/Library/LaunchAgents"
uid="$(id -u "$(whoami)")"
test -d "$agent"
for file in "$DOTFILES"/macOS/LaunchAgents/*.plist; do
filename="$(basename $file)"
path="$agent/$filename"
if ! test -e "$path"; then
echo "Installing Agent: $filename"
cp "$file" "$path"
launchctl enable "user/$uid/$filename"
fi
done