#!/bin/bash
# - bof - #



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

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



<<'comment'

bash <(curl -s https://www.education.isdevelopment.us/Arch.Ins/25-Arch_Gnome-Desktop-Install-Wayland.sh)



# -  - #
# - Documentation - #
https://www.debugpoint.com/wayland-arch-linux/



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

# - Method   # 1 - #
bash <(curl -s https://www.education.isdevelopment.us/Arch.Ins/25-Arch_Gnome-Desktop-Install-Wayland.sh)

# - Method   # 2 - #
cd ~/;
cdI_=Arch_Gnome-Desktop-Install-Wayland.sh;
curl -o ~/$cdI_ https://www.education.isdevelopment.us/Arch.Ins/25-$cdI_;
vim ~/$cdI_;
chmod +x ~/$cdI_; ~/./$cdI_;

# - Method   # 3 - #
cd ~/; rm -rf ~/Arch_Gnome-Desktop-Install-Wayland.sh; nvim ~/Arch_Gnome-Desktop-Install-Wayland.sh;
Copy & paste all this content
chmod +x ~/Arch_Gnome-Desktop-Install-Wayland.sh; ~/./Arch_Gnome-Desktop-Install-Wayland.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 screenfetch tree -y;
sudo pacman -S curl git htop inxi net-tools ntp neovim screenfetch tree --noconfirm --needed;
comment



# -  - #
# - Greetings_ - #
function Greetings_(){
  Header_;
  echo -e "\nby Djalmar Enrique Rayo (2025) - GNU General Public License (GPL)";
  echo "----------------------- Light version: $lightVersion_ -----------------------";
  echo -e "\n  Warning: This script is going to install the Gnome-Desktop Wayland 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/25-Arch_Gnome-Desktop-Install-Wayland.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_Gnome-Desktop-Install-Wayland.sh;
          exit;
          break;;
        * ) echo "Please answer (y)es or (n)o.";;
    esac
done
}



# -  - #
# - Header_ - #
function Header_(){
  clear;
  echo "";
  figlet -f small "Gnome Desktop" | lolcat;
  figlet -f small "Environment" | lolcat;
}



# -  - #
# - gnomeDesktop_ - #
function gnomeDesktop_(){
  echo -e "\n\n\nInstalling Gnome Desktop...\n\n";

  lPrograms1_="adwaita-icon-theme fwupd gnome gnome-browser-connector \
               gnome-backgrounds gnome-control-center gnome-menus \
               gnome-multi-writer gnome-nettool gnome-shell \
               gnome-system-monitor gnome-terminal gnome-tweaks gnome-usage \
               nautilus nemo-fileroller xdg-user-dirs-gtk";
  tInstall_=$(sPackages_ "$lPrograms1_");
  sudo pacman -S $tInstall_ --noconfirm --needed;
  sudo pacman -S gnome-extra --noconfirm --needed;

  echo -e "\n\nExtension manager will be installed...\n";
  #sudo mkdir -p /var/lib/flatpak/repo;
  sudo flatpak install flathub com.mattjakeman.ExtensionManager -y;
  echo -e "\nCheck for errors...\n";

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



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



Greetings_ Arch_Gnome-Desktop-Install-Wayland.sh;
checkComputer_;
Log_ 5;
distroVersion_;
update_;
wayland_;
gdm_;
gnomeDesktop_;

rm -rf ~/Arch_Gnome-Desktop-Install-Wayland.sh;



echo -e "\n\nThe system will reboot in 10 seconds...\n";
sleep 10;

sudo reboot now;



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



# - eof - #