remove zsh add fish

This commit is contained in:
2026-11-06 09:10:01 +00:00
parent ec808d1acd
commit 3dc0932901
+41 -66
View File
@@ -31,6 +31,8 @@ trap cleanup EXIT
export DEBIAN_FRONTEND=noninteractive
APT_PACKAGES=(
fish
pandoc
build-essential
wl-clipboard
mpv
@@ -79,8 +81,6 @@ APT_PACKAGES=(
podman
openssh-server
unixodbc-dev
dbeaver-ce
zsh
patchelf
ccache
pkg-config
@@ -95,79 +95,47 @@ sudo apt-get upgrade -y
ACCEPT_EULA=Y sudo apt-get install -y "${APT_PACKAGES[@]}"
# ============================================================
# Set zsh as default shell
# Set fish as default shell
# ============================================================
echo "=== zsh default shell ==="
if [[ "$(getent passwd "$USER" | cut -d: -f7)" != *"zsh"* ]]; then
chsh -s "$(which zsh)"
echo "*** zsh set as default shell — log out/in required for full effect. ***"
echo "=== fish default shell ==="
if [[ "$(getent passwd "$USER" | cut -d: -f7)" != *"fish"* ]]; then
chsh -s "$(which fish)"
echo "*** fish set as default shell — log out/in required for full effect. ***"
fi
# ============================================================
# oh-my-zsh
# fish config
# ============================================================
echo "=== oh-my-zsh ==="
ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"
if [[ ! -d "$HOME/.oh-my-zsh" ]]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi
echo "=== fish config ==="
mkdir -p "$HOME/.config/fish"
FISHCFG="$HOME/.config/fish/config.fish"
cat > "$FISHCFG" << 'FISHCFG_EOF'
fish_add_path -g $HOME/.cargo/bin
fish_add_path -g $HOME/.local/bin
fish_add_path -g /usr/local/go/bin
set -gx GOPATH $HOME/go
fish_add_path -g $GOPATH/bin
fish_add_path -g $HOME/.atuin/bin
fish_add_path -g /opt/mssql-tools18/bin
# ============================================================
# zsh plugins (syntax-highlighting + autosuggestions)
# ============================================================
echo "=== zsh plugins ==="
ZSH_HIGHLIGHT_REPO="https://github.com/zsh-users/zsh-syntax-highlighting.git"
ZSH_AUTOSUGGEST_REPO="https://github.com/zsh-users/zsh-autosuggestions.git"
if [[ ! -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ]]; then
git clone --depth 1 "$ZSH_HIGHLIGHT_REPO" "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
fi
if [[ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ]]; then
git clone --depth 1 "$ZSH_AUTOSUGGEST_REPO" "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
fi
# ============================================================
# .zshrc
# ============================================================
echo "=== .zshrc ==="
ZSHRC="$HOME/.zshrc"
cat > "$ZSHRC" << 'ZSHRC_EOF'
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="$PATH:/usr/local/go/bin"
export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin"
export PATH="$HOME/.atuin/bin:$PATH"
. "$HOME/.local/bin/env"
eval "$(atuin init zsh)"
eval "$(zoxide init zsh)"
atuin init fish | source
zoxide init fish | source
alias gp='git push'
alias gcm='git commit -m'
alias gsw='git switch'
alias gst='git status'
alias gaa='git add .'
alias ga='git add'
alias ga='git add .'
alias gtree='git log --graph --oneline --decorate --all'
alias cd='z'
alias cdi='zi'
ZSHRC_EOF
function cd
z $argv
end
FISHCFG_EOF
# ============================================================
# tmux — default shell to zsh, vi mode
# tmux — default shell to fish, vi mode
# ============================================================
echo "=== tmux config ==="
TMUX_CONF="$HOME/.tmux.conf"
@@ -175,7 +143,7 @@ if [[ ! -f "$TMUX_CONF" ]]; then
touch "$TMUX_CONF"
fi
if ! grep -qF 'set-option -g default-shell' "$TMUX_CONF"; then
printf 'set-option -g default-shell %s\n' "$(which zsh)" >> "$TMUX_CONF"
printf 'set-option -g default-shell %s\n' "$(which fish)" >> "$TMUX_CONF"
fi
if ! grep -qF 'set-window-option -g mode-keys vi' "$TMUX_CONF"; then
printf 'set-window-option -g mode-keys vi\n' >> "$TMUX_CONF"
@@ -249,6 +217,14 @@ if ! command -v uv >/dev/null 2>&1; then
cargo install --locked uv
fi
# ============================================================
# typst
# ============================================================
if ! command -v uv >/dev/null 2>&1; then
cargo install --locked typst
fi
# ============================================================
# fzf
# ============================================================
@@ -344,7 +320,6 @@ sudo systemctl enable --now libvirtd.service
# ============================================================
echo "=== Done ==="
echo "zsh is the default shell — log out and back in."
echo "tmux is configured to use zsh as default-shell."
echo "oh-my-zsh with syntax-highlighting + autosuggestions installed."
echo "Rust and Cargo are at ~/.cargo/bin — added to .zshrc and .bashrc."
echo "fish is the default shell — log out and back in."
echo "tmux is configured to use fish as default-shell."
echo "Rust and Cargo are at ~/.cargo/bin — added to fish and .bashrc."