#!/usr/bin/env bash

set -e

# RaveOS Setup Script

# Text Colours
bold=$(tput bold)      # ${bold}
normal=$(tput sgr0)    # ${normal}
yellow=$(tput setaf 3) # ${yellow}

  
  echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/99-t

# Installing packages

    sudo pacman -S wget unzip --noconfirm

    # Downloading RavePkg
    mkdir cosmetics
    sudo chown -R $USER:$GROUP /home/$USER/cosmetics/
    cd cosmetics
    wget -O cosmetics.zip https://files.rp1.hu/api/public/dl/K7znaGkC/
    unzip cosmetics.zip
   

    
    
    echo
    echo ---------------------------------------------
    echo Installing ${bold}${yellow}CachyOS - Gaming Kernel${normal}

    curl https://mirror.cachyos.org/cachyos-repo.tar.xz -o cachyos-repo.tar.xz
    tar xvf cachyos-repo.tar.xz && cd cachyos-repo
    cp /home/$USER/cosmetics/cachyos-repo.sh /home/$USER/cosmetics/cachyos-repo/
    sudo ./cachyos-repo.sh
    cd -
    sudo pacman -S linux-cachyos linux-cachyos-headers --noconfirm

    echo ${bold}${yellow}CachyOS - Gaming Kernel ${normal}installed.
    echo ---------------------------------------------
    echo



    reboot