mirror of
https://github.com/correl/dotfiles.git
synced 2024-12-24 11:50:49 +00:00
18 lines
507 B
Bash
18 lines
507 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
_recipe _link
|
|
|
|
_launchd() {
|
|
local service=$1
|
|
local filename="${service}.plist"
|
|
local source=${HOME}/dotfiles/Library/LaunchAgents/${filename}
|
|
local target=${HOME}/Library/LaunchAgents/${filename}
|
|
if launchctl list $service >/dev/null 2>&1; then
|
|
echo "[launchd] $service already installed, skipping."
|
|
else
|
|
mkdir -p ${HOME}/Library/LaunchAgents
|
|
_link $source $target
|
|
_run "[launchd] Install $service" launchctl load $target
|
|
fi
|
|
}
|