Add a LaunchAgent for copying zsh environment vars into MacOS graphical environment on login

This commit is contained in:
Danielle McLean 2017-03-15 10:07:45 +11:00
parent a915289a41
commit 8cd64d3dd1
No known key found for this signature in database
GPG key ID: A34CF3DC7C0846AC
3 changed files with 23 additions and 0 deletions

View file

@ -1 +1,2 @@
config => .config
local => .local

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>me.00dani.osx-env-sync</string>
<key>ProgramArguments</key>
<array>
<string>zsh</string>
<string>-lc</string>
<string>osx-env-sync</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

6
local/bin/osx-env-sync Executable file
View file

@ -0,0 +1,6 @@
#!/bin/zsh
for name in ${(k)parameters}; do
[[ ${parameters[$name]} == scalar-export ]] || continue
print $name=${(P)name}
launchctl setenv $name ${(P)name}
done