consolidate dotfiles and add fix script
This commit is contained in:
44
install.sh
44
install.sh
@@ -1,55 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
# A script to install all the software and tools for the dotfiles environment.
|
||||
# A script to install all software for the dotfiles environment.
|
||||
|
||||
echo "--- Starting Environment Setup ---"
|
||||
|
||||
# --- 1. Install Core Packages with APT ---
|
||||
# 1. Install core packages with apt
|
||||
echo "--> Installing core packages with apt..."
|
||||
sudo apt update
|
||||
sudo apt install -y build-essential curl git zsh ripgrep btop bat zoxide eza fuse3 sshfs gh
|
||||
|
||||
# --- 2. Install Oh My Zsh and Required Plugins (Non-interactive) ---
|
||||
# 2. Install Oh My Zsh and required plugins
|
||||
if [ ! -d "$HOME/.oh-my-zsh" ]; then
|
||||
echo "--> Installing Oh My Zsh..."
|
||||
# The --unattended flag runs the installer without prompts
|
||||
echo "--> Installing Oh My Zsh and plugins..."
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
||||
|
||||
echo "--> Installing OMZ plugins (P10k, Autosuggestions, Syntax Highlighting)..."
|
||||
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||
else
|
||||
echo "--> Oh My Zsh already installed. Skipping."
|
||||
fi
|
||||
|
||||
# --- 3. Install Rust and Cargo ---
|
||||
# 3. Install Rust and Cargo
|
||||
if ! command -v cargo &> /dev/null; then
|
||||
echo "--> Installing Rust and Cargo..."
|
||||
# The -y flag answers "yes" to the default installation prompt
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
# Add cargo to the current session's PATH
|
||||
source "$HOME/.cargo/env"
|
||||
else
|
||||
echo "--> Rust/Cargo already installed. Skipping."
|
||||
fi
|
||||
|
||||
# --- 4. Install Tools with Cargo ---
|
||||
echo "--> Installing Cargo packages (atuin, zellij, starship, etc.)..."
|
||||
# 4. Install tools with Cargo
|
||||
echo "--> Installing Cargo packages..."
|
||||
cargo install atuin zellij dua-cli navi tealdeer starship yazi-fm
|
||||
|
||||
# --- 5. Install FZF ---
|
||||
# 5. Install FZF
|
||||
if [ ! -d "$HOME/.fzf" ]; then
|
||||
echo "--> Installing FZF..."
|
||||
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
||||
# The --all flag answers "yes" to all installer questions
|
||||
~/.fzf/install --all
|
||||
else
|
||||
echo "--> FZF already installed. Skipping."
|
||||
fi
|
||||
|
||||
# 6. Install Lazygit
|
||||
if ! command -v lazygit &> /dev/null; then
|
||||
echo "--> Installing Lazygit..."
|
||||
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": *"v\K[^"]*')
|
||||
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
|
||||
tar xf lazygit.tar.gz lazygit
|
||||
sudo install lazygit /usr/local/bin
|
||||
rm lazygit lazygit.tar.gz
|
||||
fi
|
||||
|
||||
echo "--- Software installation complete! ---"
|
||||
echo "Next steps:"
|
||||
echo "1. Run 'chsh -s $(which zsh)' to set Zsh as your default shell."
|
||||
echo "2. Run the 'manage_configs.sh' script to symlink your configuration files."
|
||||
echo "3. Log out and log back in for all changes to take effect."
|
||||
echo "1. Run './manage_configs.sh' to symlink your configuration files."
|
||||
echo "2. Log out and log back in for all changes to take effect."
|
||||
|
||||
Reference in New Issue
Block a user