diff options
| author | Igor Soarez <igor@soarez.org> | 2026-09-17 19:45:23 +0100 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-09-17 19:45:23 +0100 |
| commit | 13cc065ec014b86369dfe4ad60d1a43fa06fd251 (patch) | |
| tree | 684690c61b7b59758c2aac132c65b81c86de0608 /bin/neovide-fix.sh | |
dotfiles
Shell, editor and terminal configuration, the tools that go with them, and
szecret, an age-based secret manager whose store lives elsewhere.
History restarts here. What came before was not written to be read by
anyone else, and carried machine names, addresses and an encrypted secret
store; it is kept privately instead. What is left is meant to be safe on
any machine, including one whose owner is not me: see CLAUDE.md for the
rule it is written to.
Diffstat (limited to 'bin/neovide-fix.sh')
| -rwxr-xr-x | bin/neovide-fix.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/neovide-fix.sh b/bin/neovide-fix.sh new file mode 100755 index 0000000..f8d92ad --- /dev/null +++ b/bin/neovide-fix.sh @@ -0,0 +1,36 @@ +#!/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!" + |
