summaryrefslogtreecommitdiff
path: root/dotfiles-darwin/launchd
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles-darwin/launchd')
-rw-r--r--dotfiles-darwin/launchd/Makefile8
-rw-r--r--dotfiles-darwin/launchd/org.awhk.env.plist14
2 files changed, 22 insertions, 0 deletions
diff --git a/dotfiles-darwin/launchd/Makefile b/dotfiles-darwin/launchd/Makefile
new file mode 100644
index 0000000..54d7b2a
--- /dev/null
+++ b/dotfiles-darwin/launchd/Makefile
@@ -0,0 +1,8 @@
+export ENV_SH := $(realpath ../bin/env.sh)
+
+all: $(foreach plist, $(wildcard *.plist), ~/Library/LaunchAgents/${plist})
+
+~/Library/LaunchAgents/%.plist: %.plist
+ envsubst < $< >$@
+ -launchctl unload $@ 2>/dev/null
+ launchctl load $@
diff --git a/dotfiles-darwin/launchd/org.awhk.env.plist b/dotfiles-darwin/launchd/org.awhk.env.plist
new file mode 100644
index 0000000..f2da1d5
--- /dev/null
+++ b/dotfiles-darwin/launchd/org.awhk.env.plist
@@ -0,0 +1,14 @@
+<?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>org.awhk.env</string>
+
+ <key>Program</key>
+ <string>${ENV_SH}</string>
+
+ <key>RunAtLoad</key>
+ <true/>
+ </dict>
+</plist>