oh-my-zsh rework + LiteLLM model presets
This commit is contained in:
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# Idempotent install: ensure zsh + oh-my-zsh, then symlink configs.
|
||||
set -euo pipefail
|
||||
SRC=$(cd "$(dirname "$0")" && pwd)
|
||||
|
||||
# 1. zsh (workspace base image may or may not have it)
|
||||
if ! command -v zsh >/dev/null 2>&1; then
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y --no-install-recommends zsh
|
||||
fi
|
||||
|
||||
# 2. oh-my-zsh
|
||||
if [ ! -d "$HOME/.oh-my-zsh" ]; then
|
||||
RUNZSH=no CHSH=no KEEP_ZSHRC=yes \
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
fi
|
||||
|
||||
# 3. zsh plugins (autosuggestions + syntax highlighting)
|
||||
ZSH_CUSTOM=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}
|
||||
[ -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ] || \
|
||||
git clone -q https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
|
||||
[ -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ] || \
|
||||
git clone -q https://github.com/zsh-users/zsh-syntax-highlighting "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
|
||||
|
||||
# 4. symlink every file under home/ into $HOME (idempotent)
|
||||
while IFS= read -r f; do
|
||||
rel=${f#"$SRC/home/"}
|
||||
mkdir -p "$HOME/$(dirname "$rel")"
|
||||
ln -sf "$SRC/home/$rel" "$HOME/$rel"
|
||||
done < <(find "$SRC/home" -mindepth 1 -type f)
|
||||
|
||||
# 5. default shell -> zsh
|
||||
CURSHELL=$(getent passwd "$USER" | cut -d: -f7)
|
||||
if [ "$CURSHELL" != "$(command -v zsh)" ]; then
|
||||
sudo chsh -s "$(command -v zsh)" "$USER" || true
|
||||
fi
|
||||
|
||||
echo "dotfiles installed: zsh + ohmyzsh + symlinks from $SRC/home"
|
||||
Reference in New Issue
Block a user