summaryrefslogtreecommitdiff
path: root/dotfiles-darwin/launchd/Makefile
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2020-07-05 01:43:34 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2020-07-05 01:43:34 +0100
commit4435c0efc83b8fd0c2cae0a5fe0ce886b794552b (patch)
treeb8374325bbdf607499009e47953890e833da8b71 /dotfiles-darwin/launchd/Makefile
parent37a5938a0fb4d04ce9684ba2cfc517cb8e947926 (diff)
darwin/bin: Add env.sh
This short script defines a few environment variables with launchctl so macOS apps can access them.
Diffstat (limited to 'dotfiles-darwin/launchd/Makefile')
-rw-r--r--dotfiles-darwin/launchd/Makefile8
1 files changed, 8 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 $@