2024-06-30 17:12:07 +00:00
#!/bin/bash
2024-07-02 08:44:26 +00:00
scripts_PATH = $1 /arch-automated-installer
2024-06-30 17:12:07 +00:00
username = $( whoami)
home_PATH = /home/$username
echo -e "\n\n\n\n"
echo ""
echo "===================="
echo " Arch Desktop Setup "
echo "===================="
echo ""
2024-07-05 11:06:40 +00:00
sudo pacman -Syu
2024-06-30 17:12:07 +00:00
while true; do
read -p "Enter a dotfiles repository (enter to skip): " repo
if [ [ ! -z $repo ] ] ; then
if [ [ ! -f /bin/git ] ] ; then
echo " Authentication Is Required. Enter $username 's password "
2024-07-02 07:23:27 +00:00
sudo pacman -S --noconfirm --needed git
2024-06-30 17:12:07 +00:00
echo ""
fi
if [ [ ! -d $home_PATH /Repos ] ] ; then
2024-07-02 07:23:27 +00:00
mkdir $home_PATH /Repos
2024-06-30 17:12:07 +00:00
fi
2024-07-02 07:23:27 +00:00
git clone $repo $home_PATH /Repos/dotfiles
2024-06-30 17:12:07 +00:00
if [ [ $? = = 0 ] ] ; then
2024-06-30 17:53:45 +00:00
for file in $home_PATH /Repos/dotfiles/*; do
2024-07-02 07:23:27 +00:00
ln -s $file $home_PATH /.config/
2024-06-30 17:12:07 +00:00
done
break
else
echo -e "\n\n\n"
while true; do
read -p "Could not find repository. Try again? (y/n): " response
if [ [ " ${ response ,, } " = = "y" ] ] ; then
redo = " ${ response ,, } "
break
elif [ [ " ${ response ,, } " = = "n" ] ] ; then
redo = " ${ response ,, } "
break
else
echo "Invalid Response (y/n)"
fi
done
if [ [ $redo = = "n" ] ] ; then
break
fi
fi
else
break
fi
done
echo -e "\n\n\n\n"
echo ""
echo "=================="
echo " Install Packages "
echo "=================="
echo ""
2024-07-02 07:23:27 +00:00
sudo pacman -S --noconfirm --needed base-devel
2024-06-30 17:12:07 +00:00
while IFS = read -r line ; do
2024-07-02 07:23:27 +00:00
sudo pacman -S --noconfirm --needed $line
2024-06-30 17:53:45 +00:00
done < $scripts_PATH /arch-assets/archpkg.txt
2024-06-30 17:12:07 +00:00
echo -e "\n\n\n\n"
echo ""
echo "=================="
echo " Setup Essentials "
echo "=================="
echo ""
# Setup Firewall
echo "Setup UFW"
echo ""
2024-07-02 07:23:27 +00:00
sudo ufw default deny incoming
sudo ufw default allow outgoing
2024-06-30 17:12:07 +00:00
# Allow SSH on Default port
2024-07-02 07:23:27 +00:00
sudo ufw allow 22
2024-06-30 17:12:07 +00:00
# Allow SSH on Alternate Port
echo ""
read -p "Would you like to set an alternate SSH port? (Empty to skip) " sshPort
if [ [ ! -z $sshPort && $sshPort = ~ ^[ 0-9] +$ ] ] ; then
2024-07-02 07:23:27 +00:00
sudo ufw allow $sshPort
2024-06-30 17:12:07 +00:00
fi
2024-07-09 16:54:59 +00:00
sudo ufw enable
2024-06-30 17:12:07 +00:00
2024-07-09 16:54:59 +00:00
# Enable Printer
systemctl enable --now cups
# Enable SSH
systemctl enable --now sshd
# Enable Bluetooth
systemctl enable --now bluetooth
2024-06-30 17:12:07 +00:00
# Setup Yay
while true; do
read -p "Do you want to install yay? (y/n) " answer
if [ [ " ${ answer ,, } " = = "y" ] ] ; then
if [ [ ! -d $home_PATH /Software ] ] ; then
2024-07-02 07:23:27 +00:00
mkdir $home_PATH /Software
2024-06-30 17:12:07 +00:00
fi
2024-07-02 07:23:27 +00:00
git clone https://aur.archlinux.org/yay.git $home_PATH /Software/yay && cd $home_PATH /Software/yay && makepkg -si --noconfirm --needed && cd
2024-06-30 17:12:07 +00:00
break
elif [ [ " ${ answer ,, } " = = "n" ] ] ; then
break
else
echo "Invalid Response (y/n)"
fi
done
2024-07-01 01:20:46 +00:00
echo -e "\n\n\n\n"
echo ""
echo "========"
echo " Tweaks "
echo "========"
echo ""
# Get JetBrainsMono font
2024-07-02 08:44:26 +00:00
while true; do
2024-07-02 08:54:40 +00:00
read -p "Do you want to install JetBrainsMono Nerd Font? (y/n):" answer
2024-07-02 08:44:26 +00:00
if [ [ " ${ answer } " = = "y" ] ] ; then
font_PATH = " $home_PATH /.local/share/fonts "
if [ [ ! -d $font_PATH ] ] ; then
mkdir $font_PATH
fi
mkdir $font_PATH /JetBrainsMono
cd $font_PATH /JetBrainsMono
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.tar.xz
2024-07-02 08:54:40 +00:00
echo ""
tar -xvf "JetBrainsMono.tar.xz"
2024-07-02 08:44:26 +00:00
cd ""
echo ""
break
elif [ [ " ${ answer } " = = "n" ] ] ; then
echo "Skipping JetBrainsMono Nerd Font Install"
break
else
echo "Invalid Response (y/n)"
fi
done
2024-07-01 01:20:46 +00:00
2024-07-09 17:13:24 +00:00
# Setting up lockscreen
systemctl enable --now betterlockscreen@$username
2024-07-09 16:54:59 +00:00
# Setting up my bash
echo -ne "
source .config/bash/my_bashrc.sh" >> $home_PATH /.bashrc
2024-07-01 06:21:53 +00:00
2024-06-30 17:12:07 +00:00
echo -e "\n\n\n\n"
echo ""
echo "=================="
echo " Gaming Setup "
echo "=================="
echo ""
while true; do
read -p "Do you want to install the Gaming Setup? (y/n) " answer
if [ [ " ${ answer ,, } " = = "y" ] ] ; then
argument = " $scripts_PATH /arch-assets/archgamingpkg.txt "
bash $scripts_PATH /scripts/archgamingsetup.sh $argument
break
elif [ [ " ${ answer ,, } " = = "n" ] ] ; then
break
else
echo "Invalid Response (y/n)"
fi
done
echo -e "\n\n\n\n"
echo ""
echo "================="
echo " Game Dev Apps "
echo "================="
echo ""
while true; do
read -p "Do you want to install the Gaming Development Setup? (y/n) " answer
if [ [ " ${ answer ,, } " = = "y" ] ] ; then
argument = " $scripts_PATH /arch-assets/archgamedevpkg.txt "
bash $scripts_PATH /scripts/archgamedevsetup.sh $argument
break
elif [ [ " ${ answer ,, } " = = "n" ] ] ; then
break
else
echo "Invalid Response (y/n)"
fi
done
2024-07-09 17:17:27 +00:00
echo -ne "
Script ran successfully. Please take a look at the 'tweaks' section in the README for further instruction on certain things you might have to enable or do to get things to run perfectly.
"