#!/bin/bash

# Master Installation Script for Hyprland Rice on CachyOS
# Runs all installation and setup scripts in the correct order

set -e

echo "🚀 OCbwoy3 Dotfiles - CachyOS"
echo "============================="
echo ""

# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

echo "📋 This script will:"
echo "   1. Install all required packages for your Hyprland rice"
echo "   2. Install Ralsei cursors"
echo "   3. Set up configuration symlinks and final configuration"
echo ""
echo "⚠️  This process may take a while and will require sudo privileges"
echo ""
read -p "Continue? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
    echo "❌ Installation cancelled"
    exit 1
fi

echo ""
echo "🔧 CHModing +x install scripts"
chmod +x "$SCRIPT_DIR"/*.sh

echo ""
echo "📦 [1/3] Install packages"
"$SCRIPT_DIR/install-packages.sh"

echo ""
echo "🎮 [2/3] Installing cursors"
"$SCRIPT_DIR/install-cursors.sh"

echo ""
echo "⚙️ [3/3] Installing Hyprland"
"$SCRIPT_DIR/setup.sh"

echo "🚀 Done!"