mirror of
https://github.com/correl/dotfiles.git
synced 2024-12-18 03:00:11 +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
|
|
}
|