Update darwin variables

This commit is contained in:
David Tomaschik
2025-09-25 05:11:22 -07:00
parent e270bac5f2
commit 375ff434f2
2 changed files with 24 additions and 0 deletions

8
bin/darwin-env.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
env > ${TMPDIR}/env-pre
. ${HOME}/.shenv
env > ${TMPDIR}/env-post
for VAR in $(env | cut -d'=' -f1) ; do
/bin/launchctl setenv "${VAR}" "$(eval echo \$${VAR})"
done

16
darwin-env.plist Normal file
View File

@@ -0,0 +1,16 @@
<?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>com.user.loadvars</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>~/bin/darwin-env.sh || true</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>