From b4815d1130ff069259e7841bc8e8ba89213b5aa9 Mon Sep 17 00:00:00 2001 From: Fabian Ising Date: Tue, 13 Oct 2026 10:29:09 +0200 Subject: [PATCH] [ZSH] Speed up shell startup Move antidote update from every shell start to update_mac.sh: it dropped the bundle cache each time, forcing a rebuild on the next start. Background the locale write and skip the brew --repository fork. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- update_mac.sh | 5 +++++ zsh/.mac_config.zsh_mac.example | 5 +++-- zsh/.zshrc | 1 - 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 13de857..54dc287 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,5 +33,5 @@ Practical rule: **edit the `.example` source, not the generated symlink target.* ## Maintenance -- `./update_mac.sh` — macOS update runner. Default (no args) runs `--brew-update --cleanup --diagnostics --update-others`; other flags: `--system-update`, `--permission-fix` (strips Caskroom/App quarantine xattrs). Run `./update_mac.sh --help` for the list. `--update-others` also updates Alacritty from its verified upstream release, then runs `claude --update` and `Codex --update`. +- `./update_mac.sh` — macOS update runner. Default (no args) runs `--brew-update --cleanup --diagnostics --update-others`; other flags: `--system-update`, `--permission-fix` (strips Caskroom/App quarantine xattrs). Run `./update_mac.sh --help` for the list. `--update-others` also updates Alacritty from its verified upstream release and antidote plugins (not updated at shell start), then runs `claude --update` and `Codex --update`. - `brew_autoupdate` — runs scheduled brew and Alacritty auto-updates. diff --git a/update_mac.sh b/update_mac.sh index 5876280..287e2cd 100755 --- a/update_mac.sh +++ b/update_mac.sh @@ -66,6 +66,11 @@ function update_others { echo "-- ALACRITTY" "$SCRIPT_DIR/install_alacritty_mac.sh" || echo "Alacritty update failed." >&2 + if [ -f "$HOME/.antidote/antidote.zsh" ]; then + echo "-- ANTIDOTE" + zsh "$HOME/.antidote/antidote.zsh" update + fi + if [ -x "$(command -v claude)" ]; then echo "-- CLAUDE" claude --update diff --git a/zsh/.mac_config.zsh_mac.example b/zsh/.mac_config.zsh_mac.example index 5cadaa8..42d2567 100644 --- a/zsh/.mac_config.zsh_mac.example +++ b/zsh/.mac_config.zsh_mac.example @@ -1,7 +1,8 @@ export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export JAVA_HOME=`/usr/libexec/java_home` -defaults write .GlobalPreferences AppleLocale en_DE +# macOS resets this on updates (and at random); background it, it's slow +defaults write .GlobalPreferences AppleLocale en_DE &! # Set path to work with pycharm ... # [[ "$PATH" =~ /usr/local/bin ]] || export PATH=$PATH:/usr/local/bin @@ -27,7 +28,7 @@ alias tailscale=/Applications/Tailscale.app/Contents/MacOS/Tailscale #alias virt-manager="LD_PRELOAD=/opt/homebrew/Cellar/glib/2.86.0/lib virt-manager" #alias virt-manager="LD_PRELOAD=/opt/homebrew/Cellar/glib/2.86.0/lib $HOME/python-envs/virt-manager/bin/python3 $HOME/stuff/virt-manager/virt-manager" -HOMEBREW_COMMAND_NOT_FOUND_HANDLER="$(brew --repository)/Library/Homebrew/command-not-found/handler.sh" +HOMEBREW_COMMAND_NOT_FOUND_HANDLER="${HOMEBREW_REPOSITORY:-$(brew --repository)}/Library/Homebrew/command-not-found/handler.sh" if [ -f "$HOMEBREW_COMMAND_NOT_FOUND_HANDLER" ]; then source "$HOMEBREW_COMMAND_NOT_FOUND_HANDLER"; fi diff --git a/zsh/.zshrc b/zsh/.zshrc index 5eb60d2..3b46aaf 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -67,7 +67,6 @@ source "${ZDOTDIR:-$HOME}/.zsh/lib/prompt.zsh" alias screenshot_mode='powerlevel10k_plugin_unload; export PS1="$ "; python3 ~/.config/alacritty/screenshot_mode.py on' alias screenshot_mode_off='prompt_powerlevel9k_setup; python3 ~/.config/alacritty/screenshot_mode.py off' -antidote update &>/dev/null &| [[ -d "$HOME/.lmstudio/bin" ]] && path+=("$HOME/.lmstudio/bin") [[ -d "$HOME/.runai/bin" ]] && path+=("$HOME/.runai/bin")