#!/bin/bash
# - bof - #



<<'comment'

# - Configured - #


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

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

ssh-keygen -R 192.168.1.1

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

cat ~/.ssh/id_rsa.pub;

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



xdg-user-dirs-update;
sudo apt install dialog duf curl figlet git lolcat neovim pv webapp-manager -y;
sudo apt install dialog duf curl figlet git htop inxi lolcat net-tools neovim pv webapp-manager -y;



# -  - #
# - Timezone setting - #
sudo timedatectl set-ntp true;
sudo timedatectl set-timezone America/New_York;
timedatectl;



cd ~/; rm -rf ~/bEtcher.sh; vim ~/bEtcher.sh;
Copy & paste this content
chmod +x ~/bEtcher.sh; ~/./bEtcher.sh;

comment



# -  - #
# - AdditionalSoftware_ - #
function AdditionalSoftware_(){
  sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt clean;
  sudo apt install libfuse2t64 ffmpeg -y;
}



# -  - #
# - VariablesDefinition_ - #
function VariablesDefinition_(){
  sU_=$USER;
  sDwn_=~/Downloads/
  oD_=$sDwn_'BalenaEtcher.Ins/';
  dD_=/home/$sU_/.AppImages/BalenaEtcher/;
  sLs_=/home/$sU_/.local/share/;
  dSa_=$sLs_'applications/';
  dCf_=$dSa_'BalenaEtcher.desktop';
  eF_=balenaEtcher-1.18.4-x64.AppImage;
 #eF_=balenaEtcher-1.19.25-x64.AppImage;
  iF_=BalenaEtcher1.png;
}



# -  - #
# - CopyingBalenaEtcherFiles_ - #
function CopyingBalenaEtcherFiles_(){
  mkdir -p $dSa_ $dD_;
  cp -p $oD_$eF_ $dD_;
  cp -p $oD_$iF_ $dD_;
}



# -  - #
# - CreateDesktopConfigurationFile_ - #
function CreateDesktopConfigurationFile_(){
  local eFnoSb_=$eF_' --no-sandbox';
rm -rf $dCf_;
cat <<EOF >> $dCf_;
[Desktop Entry]
Type=Application
Name=BalenaEtcher
Comment=Burn ISO file into a USB stick
Exec=$dD_$eFnoSb_
Icon=$dD_$iF_
Terminal=false
StartupWMClass=BalenaEtcher
Categories=System;
StartupNotify=false
EOF
}



# -  - #
# - CleaningUp_ - #
function CleaningUp_(){
  local dFiles_=$sDwn_'BalenaEtcher*';
  # -  - #
  # - Cleaning up ~/Downloads folder - #
  rm -rf $dFiles_ ~/bEtcher.sh;
}



clear;

AdditionalSoftware_;
VariablesDefinition_;
CopyingBalenaEtcherFiles_;
CreateDesktopConfigurationFile_;
CleaningUp_;

echo -e  "\n\n\nBalenaEtcher installed & configured successfully...\n\n";



<<'comment'
cd ~/; rm -rf ~/bEtcher.sh; vim ~/bEtcher.sh;
Copy & paste this content
chmod +x ~/bEtcher.sh; ~/./bEtcher.sh;
comment

# - eof - #