summaryrefslogtreecommitdiff
path: root/dotfiles-darwin/launchd/Makefile
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2025-02-22 11:05:43 +0000
committerGrégoire Duchêne <gduchene@awhk.org>2025-02-22 11:49:50 +0000
commitabdc8df1d2df5d2527865f765c57566336f48ef7 (patch)
treeb4c9dbe892fd129c94af8bd4bdb4ae35e377d509 /dotfiles-darwin/launchd/Makefile
parentf88d79c060c0067c590bcec2060b907de7c570cd (diff)
darwin/env.plist: Switch to JSON
Diffstat (limited to 'dotfiles-darwin/launchd/Makefile')
-rw-r--r--dotfiles-darwin/launchd/Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/dotfiles-darwin/launchd/Makefile b/dotfiles-darwin/launchd/Makefile
index 54d7b2a..cad2e9a 100644
--- a/dotfiles-darwin/launchd/Makefile
+++ b/dotfiles-darwin/launchd/Makefile
@@ -1,8 +1,9 @@
export ENV_SH := $(realpath ../bin/env.sh)
+AGENTS_DIR := ~/Library/LaunchAgents
-all: $(foreach plist, $(wildcard *.plist), ~/Library/LaunchAgents/${plist})
+all: $(foreach plist, $(wildcard *.json), $(AGENTS_DIR)/$(plist:json=plist))
-~/Library/LaunchAgents/%.plist: %.plist
- envsubst < $< >$@
+$(AGENTS_DIR)/%.plist: %.json
+ plutil -convert xml1 -o $@ - <<< $$(envsubst < $<)
-launchctl unload $@ 2>/dev/null
launchctl load $@