Files
dotfiles/bootstrap.sh
T
Dmitry 02b0ca610d refactor: remove restic timers, add scripts/configs, update docs
- resticprofile: remove all schedules (manual backups via backup-menu)
- resticprofile: fix hardcoded /home/ada paths → ~/
- proj(): find git repos by .git presence up to depth 4
- bootstrap.sh: add fzf, fd, bat, ripgrep, kitty, htop to packages
- README.md: rewrite for chezmoi (remove stow references)
- add: htoprc, betterbird_up.sh, kitty_up.sh, tg_up.sh
2026-05-13 19:47:46 +03:00

57 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
PACKAGES=("zsh" "tmux" "alacritty" "kitty" "chezmoi" "age" "fzf" "fd" "bat" "ripgrep" "eza" "zoxide" "htop")
detect_and_install() {
if command -v apt &>/dev/null; then
sudo apt update && sudo apt install -y "${PACKAGES[@]}"
elif command -v pacman &>/dev/null; then
sudo pacman -Syu --noconfirm "${PACKAGES[@]}"
elif command -v dnf &>/dev/null; then
sudo dnf install -y "${PACKAGES[@]}"
elif command -v brew &>/dev/null; then
brew install "${PACKAGES[@]}"
else
echo "Error: no supported package manager found"
echo "Please install: ${PACKAGES[*]}"
exit 1
fi
}
check_installed() {
local missing=()
for pkg in "${PACKAGES[@]}"; do
if ! command -v "$pkg" &>/dev/null; then
missing+=("$pkg")
fi
done
if [[ ${#missing[@]} -gt 0 ]]; then
echo "Missing: ${missing[*]}"
detect_and_install
fi
}
check_installed
mkdir -p "$HOME/.ssh/sockets"
# Apply dotfiles via chezmoi
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
chezmoi apply --source "$DOTFILES_DIR"
# Set zsh as default shell
set_default_shell() {
local zsh_path
zsh_path=$(command -v zsh)
read -p "Set zsh as default shell? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
chsh -s "$zsh_path"
echo "Default shell: $zsh_path"
fi
}
set_default_shell
echo "Bootstrap complete!"