Symlink .ssh/config into ~/.ssh with proper directory permissions. Guard .gitignore so only the client config is trackable — keys and anything else under .ssh/ can never be committed. Also drop a redundant tmux ignore rule. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
33 lines
1.3 KiB
Bash
33 lines
1.3 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"
|
|
mkdir -p "$HOME/.ssh"
|
|
chmod 700 "$HOME/.ssh"
|
|
backup_and_link "$DOTFILES_DIR/.ssh/config" "$HOME/.ssh/config"
|
|
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"
|
|
}
|