#!/bin/bash
# - bof - #



# -  - #
# - Overwrite checkComputer - #
 overwriteCc_="No";
#overwriteCc_="Yes";



<<'comment'

sudo pacman -S curl --noconfirm --needed;
bash <(curl -s https://www.education.isdevelopment.us/Arch.Ins/03-Arch_Xfce-Desktop-Install.sh)



# :A
# -  - #
# - Arch Xfce desktop installation script - #

# - Method   # 1 - #
sh -c "$(curl -fsSL 'https://www.education.isdevelopment.us/Arch.Ins/03-Arch_Xfce-Desktop-Install.sh')"

# - Method   # 2 - #
cd ~/;
xdI_=Arch_Xfce-Desktop-Install.sh;
curl -o ~/$xdI_ "https://www.education.isdevelopment.us/Arch.Ins/03-$xdI_"
nvim ~/$xdI_;
chmod +x ~/$xdI_; ~/./$xdI_;

# - Method   # 3 - #
cd ~/; rm -rf ~/Arch_Xfce-Desktop-Install.sh; nvim ~/Arch_Xfce-Desktop-Install.sh;
Copy & paste all this content
chmod +x ~/Arch_Xfce-Desktop-Install.sh; ~/./Arch_Xfce-Desktop-Install.sh;



# - Configured - #

# -  - #
# - Vim commands - #
https://vim.rtorr.com/

rm -rf ~/.bashrc;
nvim ~/.bashrc;

rm -rf ~/.zshrc;
nvim ~/.zshrc;

ssh-keygen -R 192.168.1.1

# - On client - #
cd ~/.ssh;
ssh-keygen -t rsa;

cat ~/.ssh/id_rsa.pub;

# - On server - #
nvim ~/.ssh/authorized_keys;

sudo apt install curl git htop inxi net-tools ntp neovim tree -y;
sudo pacman -S curl git htop inxi net-tools ntp neovim tree --noconfirm --needed;
comment



# -  - #
# - Greetings_ - #
function Greetings_(){
  Header_;
  echo -e "\n  Warning: This script is going to install the Xfce-Desktop environment"
  echo -e "\nImportant: This procedure will take a few minutes.";
  echo -e "\nProcedure: Open terminal & paste next command:\n";

cat <<"EOF"
   bash <(curl -s https://www.education.isdevelopment.us/Arch.Ins/03-Arch_Xfce-Desktop-Install.sh)
EOF

  echo -e "\n\n";

  while true; do
    read -p "Do you want to start the installation now? (Yy/Nn): " yn
    case $yn in
        [Yy]* )
          echo -e "\n\n\nInstallation starting...\n\n"
          break;;
        [Nn]* )
          rm -rf ~/Arch_Xfce-Desktop-Install.sh;
          exit;
          break;;
        * ) echo "Please answer (y)es or (n)o.";;
    esac
  done
}



# -  - #
# - Header_ - #
function Header_(){
  clear;
  echo "";
  figlet -f small "Xfce Desktop" | lolcat;
  figlet -f small "Environment" | lolcat;
  echo -e "\nby Djalmar Enrique Rayo (2025) - GNU General Public License (GPL)";
  echo "----------------------- Light version: $lightVersion_ -----------------------";
}



# -  - #
# - xfceDesktop_ - #
function xfceDesktop_(){
  echo -e "\n\n\nInstalling Xfce Desktop...\n\n";

  lPrograms1_="xfce4 xfce4-terminal";
  tInstall_=$(sPackages_ "$lPrograms1_");
  sudo pacman -S $tInstall_ --noconfirm --needed;
  sudo pacman -S xfce4-goodies --noconfirm --needed;

  echo -e "\n\nXfce desktop was installed successfully...\n\n\n";
  sleep 10;
}



source <(curl -s https://www.education.isdevelopment.us/Functions/Functions.sh)
lightVersion_=$( lVersion_ );

logF_=~/.noInstalled-Arch_Xfce-Desktop-Install_$(date +%Y-%m-%d_%H-%M-%S).log;



checkComputer_ Arch_Xfce-Desktop-Install.sh;
Greetings_;
Log_ 3;
distroVersion_;
update_;
xorg_;
lightdm_;
xfceDesktop_;

rm -rf ~/Arch_Xfce-Desktop-Install.sh;



echo -e "\n\nHard disk details...\n";
duf;
echo -e "\n\nThe system will shutdown in 10 seconds...\n";
sleep 10;

sudo shutdown now;
sudo reboot now;



<<'comment'
# -  - #
# - Uninstall lisghtdm & xfce4 - #
sudo pacman -Rns lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings --noconfirm;
sudo pacman -Rns xfce4 xfce4-goodies xfce4-terminal --noconfirm;

cd ~/; rm -rf ~/Arch_Xfce-Desktop-Install.sh; nvim ~/Arch_Xfce-Desktop-Install.sh;
Copy & paste all this content
chmod +x ~/Arch_Xfce-Desktop-Install.sh; ~/./Arch_Xfce-Desktop-Install.sh;
comment



# - eof - #