diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2021-11-13 14:05:49 +0000 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2021-11-13 14:05:49 +0000 |
| commit | 722c3b6922748b29a06df4376274a620091e0d75 (patch) | |
| tree | 386d43be26199c2ddfe4e255b2eb3d9a2d330d3c /dotfiles-darwin/bin | |
| parent | 93ba6231f35882a9b94214a8568ec2a5b210f2e8 (diff) | |
emacs: Drop exec-path-from-shell
This is mostly done with a horrible hack on how macOS app bundles get
their PATH set correctly.
Diffstat (limited to 'dotfiles-darwin/bin')
| -rwxr-xr-x | dotfiles-darwin/bin/env.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/dotfiles-darwin/bin/env.sh b/dotfiles-darwin/bin/env.sh index 8a13605..7a9d7e5 100755 --- a/dotfiles-darwin/bin/env.sh +++ b/dotfiles-darwin/bin/env.sh @@ -1,5 +1,15 @@ #!/usr/bin/env zsh -for env in DOMAIN HOST UNAME XDG_{{CACHE,CONFIG,DATA}_HOME,RUNTIME_DIR}; do +for env (DOMAIN HOST SSH_AUTH_SOCK UNAME + XDG_{{CACHE,CONFIG,DATA}_HOME,RUNTIME_DIR}); do launchctl setenv ${env} ${(P)env} done + +# PATH is magic on macOS, and since it only matters for Emacs, let’s +# make it work in Emacs only. Yep, it’s pretty bad. +local plist=~/Applications/Emacs.app/Contents/Info.plist +if [[ -f ${plist} ]]; then + plutil -replace LSEnvironment -dictionary ${plist} + plutil -insert LSEnvironment.PATH -string "${PATH}" ${plist} + /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f ${plist:h:h} +fi |
