feat(zsh): support cross-platform shell setup

This commit is contained in:
2026-10-11 12:24:19 -04:00
parent f47e69f438
commit 525f55487f
3 changed files with 42 additions and 17 deletions
+25
View File
@@ -0,0 +1,25 @@
{{ if eq .chezmoi.os "darwin" -}}
# Initialize Homebrew on Apple Silicon or Intel Macs.
if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /usr/local/bin/brew ]]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
{{ else if eq .chezmoi.os "linux" -}}
if [[ -f "$HOME/.config/scripts/setup.sh" ]]; then
sh "$HOME/.config/scripts/setup.sh" -nr
fi
{{ end }}
# Load user settings from config file.
if [[ -f "$HOME/.config/settings.conf" ]]; then
source "$HOME/.config/settings.conf"
fi
{{ if eq .chezmoi.os "linux" -}}
if [[ $computer == 'w530' ]]; then
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi
fi
{{ end -}}