#!/bin/zsh # Make Neovide.app start through a wrapper that sources ~/.zshrc, so the GUI # app sees the same PATH and environment as a terminal, then re-sign the app. # # Re-run after every Neovide update: the update replaces the app bundle and # undoes this. Needs sudo, for the re-signing. set -euo pipefail app='/Applications/Neovide.app' # Create wrapper if it doesn't exist cat > "${app}/Contents/MacOS/neovide-wrapper.sh" <<'EOF' #!/bin/zsh source ~/.zshrc exec "$(dirname "$0")/neovide" "$@" EOF chmod +x "${app}/Contents/MacOS/neovide-wrapper.sh" # Update plist to use wrapper /usr/libexec/PlistBuddy -c "Set :CFBundleExecutable neovide-wrapper.sh" "${app}/Contents/Info.plist" # Clear code signature sudo xattr -cr "${app}" # Re-sign the app sudo codesign --force --deep --sign - "${app}" # Verify signature codesign -dv "${app}" /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f "${app}" echo "Neovide fixed!"