30 lines
1.2 KiB
Bash
30 lines
1.2 KiB
Bash
#!/bin/bash
|
|
# Symlink the dotfiles into ~ and ~/.config; switch login shell to zsh.
|
|
|
|
link_dotfiles() {
|
|
info "Linking dotfiles from $DOTFILES_DIR..."
|
|
backup_and_link "$DOTFILES_DIR/.config/nvim" "$HOME/.config/nvim"
|
|
backup_and_link "$DOTFILES_DIR/.config/tmux" "$HOME/.config/tmux"
|
|
backup_and_link "$DOTFILES_DIR/.config/starship" "$HOME/.config/starship"
|
|
backup_and_link "$DOTFILES_DIR/.config/lazygit" "$HOME/.config/lazygit"
|
|
backup_and_link "$DOTFILES_DIR/.config/wezterm" "$HOME/.config/wezterm"
|
|
backup_and_link "$DOTFILES_DIR/.config/.ideavimrc" "$HOME/.ideavimrc"
|
|
backup_and_link "$DOTFILES_DIR/.zshrc" "$HOME/.zshrc"
|
|
backup_and_link "$DOTFILES_DIR/.gitconfig" "$HOME/.gitconfig"
|
|
backup_and_link "$DOTFILES_DIR/bin/dotfiles-apply-theme" "$HOME/.local/bin/dotfiles-apply-theme"
|
|
}
|
|
|
|
set_zsh_as_shell() {
|
|
local zsh_bin
|
|
zsh_bin="$(command -v zsh || true)"
|
|
[[ -n $zsh_bin ]] || {
|
|
warn "zsh not installed; skipping chsh"
|
|
return
|
|
}
|
|
if [[ $SHELL == "$zsh_bin" ]]; then
|
|
info "Login shell is already zsh"
|
|
return
|
|
fi
|
|
info "Changing login shell to $zsh_bin..."
|
|
sudo chsh -s "$zsh_bin" "$USER" || warn "chsh failed; run 'chsh -s $zsh_bin' manually"
|
|
}
|