From 4435c0efc83b8fd0c2cae0a5fe0ce886b794552b Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sun, 5 Jul 2020 01:43:34 +0100 Subject: darwin/bin: Add env.sh This short script defines a few environment variables with launchctl so macOS apps can access them. --- dotfiles-darwin/launchd/Makefile | 8 ++++++++ dotfiles-darwin/launchd/org.awhk.env.plist | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 dotfiles-darwin/launchd/Makefile create mode 100644 dotfiles-darwin/launchd/org.awhk.env.plist (limited to 'dotfiles-darwin/launchd') 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 @@ + + + + + Label + org.awhk.env + + Program + ${ENV_SH} + + RunAtLoad + + + -- cgit v1.2.3-70-g09d2