From 722c3b6922748b29a06df4376274a620091e0d75 Mon Sep 17 00:00:00 2001 From: Grégoire Duchêne Date: Sat, 13 Nov 2021 14:05:49 +0000 Subject: emacs: Drop exec-path-from-shell This is mostly done with a horrible hack on how macOS app bundles get their PATH set correctly. --- dotfiles-darwin/bin/env.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'dotfiles-darwin/bin/env.sh') 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 -- cgit v1.2.3-70-g09d2