.dotfiles/install.sh
tombdf 15b6581aa1
feat(install): add initial setup script
- Added install.sh script to automate the installation process.
- Included functions for initial checks, component installation, and
  configuration setup.
- Ensured the script runs with strict mode enabled for better error
  handling.
- Added user confirmation prompt before starting the setup.
- Displayed a completion message and prompt for system reboot.
2024-12-18 01:00:03 +01:00

50 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
clear
# Enable strict mode for bash
set -euo pipefail
# Define functions and colors
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/utils/colors.sh"
source "${SCRIPT_DIR}/utils/helpers.sh"
LOG="install.log"
[ -f "$LOG" ] && rm -f "$LOG"
touch "$LOG"
# Displau logo and information
display_header
# Initial checks
check_not_root
check_internet
check_arch
# Request confirmation
echo "┌──────────────────────────────────────┐"
echo "│ Start Setup? (y/N) │"
echo "└──────────────────────────────────────┘"
read -p "~> " inst
case $inst in
y | Y) echo -e "\nStarting setup..." ;;
*) echo -e "\nSetup cancelled." && exit 0 ;;
esac
# Install components
source "${SCRIPT_DIR}/scripts/core.sh"
source "${SCRIPT_DIR}/scripts/desktop.sh"
source "${SCRIPT_DIR}/scripts/shells.sh"
source "${SCRIPT_DIR}/scripts/development.sh"
# Setup configuration files
echo -e "${GREEN}Setting up configuration files...${DEFAULT}"
setup_dotfiles
# Final configuration
setup_final
echo -e "${GREEN}Installation completed successfully!${DEFAULT}"
echo -e "Please reboot your system to apply all changes."
exit 0