Add a LaunchAgent for copying zsh environment vars into MacOS graphical environment on login
This commit is contained in:
parent
a915289a41
commit
8cd64d3dd1
3 changed files with 23 additions and 0 deletions
|
@ -1 +1,2 @@
|
||||||
config => .config
|
config => .config
|
||||||
|
local => .local
|
||||||
|
|
16
Library/LaunchAgents/me.00dani.osx-env-sync.plist
Normal file
16
Library/LaunchAgents/me.00dani.osx-env-sync.plist
Normal 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
6
local/bin/osx-env-sync
Executable 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
|
Loading…
Reference in a new issue