From abdc8df1d2df5d2527865f765c57566336f48ef7 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 22 Feb 2025 11:05:43 +0000 Subject: darwin/env.plist: Switch to JSON --- dotfiles-darwin/launchd/Makefile | 7 ++++--- dotfiles-darwin/launchd/org.awhk.env.json | 11 +++++++++++ dotfiles-darwin/launchd/org.awhk.env.plist | 24 ------------------------ 3 files changed, 15 insertions(+), 27 deletions(-) create mode 100644 dotfiles-darwin/launchd/org.awhk.env.json delete mode 100644 dotfiles-darwin/launchd/org.awhk.env.plist 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 $@ diff --git a/dotfiles-darwin/launchd/org.awhk.env.json b/dotfiles-darwin/launchd/org.awhk.env.json new file mode 100644 index 0000000..3745c97 --- /dev/null +++ b/dotfiles-darwin/launchd/org.awhk.env.json @@ -0,0 +1,11 @@ +{ + "Label" : "org.awhk.env", + "ProgramArguments" : [ + "/bin/zsh", + "-l", + "${ENV_SH}" + ], + "RunAtLoad" : true, + "StandardErrorPath" : "${HOME}/Library/Logs/org.awhk.env.log", + "StandardOutPath" : "${HOME}/Library/Logs/org.awhk.env.log" +} diff --git a/dotfiles-darwin/launchd/org.awhk.env.plist b/dotfiles-darwin/launchd/org.awhk.env.plist deleted file mode 100644 index fd59a0c..0000000 --- a/dotfiles-darwin/launchd/org.awhk.env.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Label - org.awhk.env - - ProgramArguments - - /bin/zsh - -l - ${ENV_SH} - - - StandardOutPath - ${HOME}/Library/Logs/org.awhk.env.log - - StandardErrorPath - ${HOME}/Library/Logs/org.awhk.env.log - - RunAtLoad - - - -- cgit v1.2.3-70-g09d2