arch started
This commit is contained in:
74
v2/arch-minimal.sh
Executable file
74
v2/arch-minimal.sh
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
RED="\033[0;31m"
|
||||
GREEN="\033[0;32m"
|
||||
YELLOW="\033[0;33m"
|
||||
CYAN="\033[0;36m"
|
||||
GRAY="\033[0;37m"
|
||||
BOLD="\033[1m"
|
||||
RESET="\033[0m"
|
||||
|
||||
# Disable colors if output is not a terminal
|
||||
if [ ! -t 1 ]; then
|
||||
RED="" GREEN="" YELLOW="" CYAN="" GRAY="" BOLD="" RESET=""
|
||||
fi
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo pacman -Sy; sudo pacman -S --noconfirm --needed "$1"; }
|
||||
is_package_installed() { pacman -Qi "$1" &>/dev/null; }
|
||||
remove_packages() { sudo pacman -Rs --noconfirm "$1"; }
|
||||
|
||||
say_yellow "Starting minimal setup..."
|
||||
|
||||
# Create user directories
|
||||
mkdir -p "$HOME"/{.bin,.fonts,.icons,.themes,DATA} "$HOME/.local/share/"{icons,themes,applications} "$HOME/.config/"{autostart,gtk-{3.0,4.0},variety,fish,neofetch}
|
||||
|
||||
# Install essential tools
|
||||
install_packages wget curl nano fastfetch lolcat bash-completion starship alacritty hwinfo lshw man-db tree xdg-user-dirs rsync time bat chrony unzip chromium
|
||||
|
||||
# Optionally handle fonts
|
||||
FONT_DIR="$HOME/.local/share/fonts"
|
||||
FONT_NAME="RobotoMonoNerdFont" # Changed name to reflect the installed files
|
||||
FONT_ZIP="/tmp/RobotoMono.zip" # Use original ZIP name for download
|
||||
DOWNLOAD_NAME="RobotoMono"
|
||||
if ! find "$FONT_DIR" -name "${FONT_NAME}*.ttf" -print -quit 2>/dev/null; then
|
||||
say_yellow "Installing ${DOWNLOAD_NAME} Nerd Font..."
|
||||
mkdir -p "$FONT_DIR"
|
||||
curl -L "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/${DOWNLOAD_NAME}.zip" -o "$FONT_ZIP"
|
||||
unzip -oq "$FONT_ZIP" -d "$FONT_DIR"
|
||||
fc-cache -fv
|
||||
rm "$FONT_ZIP"
|
||||
say_green "${DOWNLOAD_NAME} installed."
|
||||
else
|
||||
say_yellow "${DOWNLOAD_NAME} Nerd Font is already installed in $FONT_DIR. Skipping installation."
|
||||
fi
|
||||
|
||||
# Enable basic services
|
||||
sudo systemctl enable chrony
|
||||
sudo systemctl enable fstrim.timer
|
||||
|
||||
# End of script
|
||||
say_green "Minimal setup completed."
|
||||
Reference in New Issue
Block a user