2024-06-24 16:55:52 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
#{{{### Pre-Setup ###
|
2024-06-27 05:08:47 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
# User Identification
|
|
|
|
username=$(whoami)
|
|
|
|
if [[ $username == "root" ]]; then
|
|
|
|
echo "Do not run this script as root"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Verify Home Directory
|
|
|
|
home_dir=/home/$username
|
|
|
|
if [[ ! -d /home/$username ]]; then
|
|
|
|
echo "Error: No valid home directory for $username"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# System Identification
|
|
|
|
if [[ -d /etc/apt/ ]]; then
|
|
|
|
system=Debian
|
|
|
|
echo "System Identified: $system"
|
|
|
|
elif [[ ! -z $(which pacman) ]]; then
|
|
|
|
system=Arch
|
|
|
|
echo "System Identified: $system"
|
|
|
|
else
|
|
|
|
echo "System could not Identified"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
script_path="$(pwd)/scripts"
|
|
|
|
|
|
|
|
# Window Manager Selection
|
|
|
|
if [[ $system == "Debian" ]]; then
|
|
|
|
echo -ne "
|
|
|
|
Window Manager Selection:
|
|
|
|
|
|
|
|
"
|
|
|
|
printf %"s\n" "1) i3wm"
|
|
|
|
printf %"s\n\n" "2) AwesomeWM"
|
|
|
|
while true; do
|
|
|
|
read -p "Enter your Selection (1-2): " answer
|
|
|
|
|
|
|
|
case $answer in
|
|
|
|
1) windowmanager=i3wm && displayserver=xorg && break;;
|
|
|
|
2) windowmanager=awesomewm && displayserver=xorg && break;;
|
|
|
|
*) echo "invalid option";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $system == "Arch" ]]; then
|
|
|
|
echo -ne "
|
|
|
|
Window Manager Selection:
|
|
|
|
|
|
|
|
"
|
2024-06-27 18:14:32 +00:00
|
|
|
printf %"s\n" "1) i3wm"
|
|
|
|
printf %"s\n" "2) AwesomeWM"
|
|
|
|
printf %"s\n\n" "3) Hyprland"
|
2024-06-28 19:13:14 +00:00
|
|
|
while true; do
|
|
|
|
read -p "Enter your Selection (1-3): " answer
|
|
|
|
|
|
|
|
case $answer in
|
|
|
|
1) windowmanager=i3wm && displayserver=xorg && break;;
|
|
|
|
2) windowmanager=awesomewm && displayserver=xorg && break;;
|
|
|
|
3) windowmanager=hyprland && displayserver=wayland && break;;
|
|
|
|
*) echo "invalid option";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# GPU Driver Identification
|
|
|
|
echo -ne "
|
|
|
|
GPU Drivers Selection:
|
|
|
|
|
|
|
|
"
|
|
|
|
printf %"s\n" "1) Virtual Machine"
|
|
|
|
#printf %"s\n" "1) Integrated Intel Graphics"
|
|
|
|
#printf %"s\n" "2) Integrated AMD Graphics"
|
|
|
|
printf %"s\n\n" "2) Nvidia GPU"
|
|
|
|
#printf %"s\n" "5) AMD GPU"
|
|
|
|
#printf %"s\n\n" "6) Intel GPU"
|
|
|
|
while true; do
|
|
|
|
read -p "Enter your Selection (1-2): " answer
|
2024-06-27 18:14:32 +00:00
|
|
|
|
|
|
|
case $answer in
|
2024-06-28 19:13:14 +00:00
|
|
|
1) gpu=vm && break;;
|
|
|
|
2) gpu=nvidia && break;;
|
2024-06-27 18:14:32 +00:00
|
|
|
*) echo "invalid option";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
# Select Audio Server
|
|
|
|
echo -ne "
|
|
|
|
Audio Drivers Selection:
|
2024-06-27 18:14:32 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
"
|
|
|
|
printf %"s\n" "1) Pipewire"
|
|
|
|
printf %"s\n\n" "2) PulseAudioGPU"
|
|
|
|
while true; do
|
|
|
|
read -p "Enter your Selection (1-2): " answer
|
2024-06-27 18:14:32 +00:00
|
|
|
case $answer in
|
2024-06-28 19:13:14 +00:00
|
|
|
1) audioserver=pipewire && break;;
|
|
|
|
1) audioserver=pulseaudio && break;;
|
2024-06-27 18:14:32 +00:00
|
|
|
*) echo "invalid option";;
|
|
|
|
esac
|
|
|
|
done
|
2024-06-28 19:13:14 +00:00
|
|
|
echo -e "
|
|
|
|
"
|
|
|
|
#}}}
|
2024-06-27 18:14:32 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
#{{{### Sudo Setup ###
|
2024-06-27 18:14:32 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
echo -e "Sudo Setup
|
2024-06-24 16:55:52 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
Enter your Root Accout Password:"
|
|
|
|
su - -c "bash $script_path/system-setup/sudo-setup.sh $system $username"
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
echo -e "
|
|
|
|
"
|
|
|
|
#}}}
|
2024-06-24 17:22:18 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
#{{{### System Setup ###
|
2024-06-27 18:14:32 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
echo -e "System Setup
|
2024-06-27 18:14:32 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
Enter $username's Password:"
|
|
|
|
sudo bash "$script_path/system-setup/git-setup.sh" $system
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
exit 2
|
2024-06-27 18:14:32 +00:00
|
|
|
fi
|
2024-06-28 19:13:14 +00:00
|
|
|
sudo bash "$script_path/system-setup/gpu-setup.sh" $system $gpu $server
|
|
|
|
sudo bash "$script_path/system-setup/audio-setup.sh" $system $audioserver
|
|
|
|
sudo bash "$script_path/system-setup/ufw-setup.sh" $system
|
|
|
|
bash "$script_path/system-setup/dotfiles-setup.sh" $username
|
|
|
|
bash "$script_path/system-setup/neovim-setup.sh" $system $username
|
|
|
|
|
|
|
|
echo "
|
|
|
|
|
|
|
|
System Setup Done
|
|
|
|
"
|
|
|
|
#}}}
|
2024-06-27 18:14:32 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
# {{{### Desktop Environment Setup ###
|
2024-06-27 05:08:47 +00:00
|
|
|
|
2024-06-28 19:13:14 +00:00
|
|
|
# }}}
|