149 lines
3.2 KiB
Bash
Executable file
149 lines
3.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#{{{### Pre-Setup ###
|
|
|
|
# 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:
|
|
|
|
"
|
|
printf %"s\n" "1) i3wm"
|
|
printf %"s\n" "2) AwesomeWM"
|
|
printf %"s\n\n" "3) Hyprland"
|
|
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
|
|
|
|
case $answer in
|
|
1) gpu=vm && break;;
|
|
2) gpu=nvidia && break;;
|
|
*) echo "invalid option";;
|
|
esac
|
|
done
|
|
|
|
# Select Audio Server
|
|
echo -ne "
|
|
Audio Drivers Selection:
|
|
|
|
"
|
|
printf %"s\n" "1) Pipewire"
|
|
printf %"s\n\n" "2) PulseAudioGPU"
|
|
while true; do
|
|
read -p "Enter your Selection (1-2): " answer
|
|
case $answer in
|
|
1) audioserver=pipewire && break;;
|
|
1) audioserver=pulseaudio && break;;
|
|
*) echo "invalid option";;
|
|
esac
|
|
done
|
|
echo -e "
|
|
"
|
|
#}}}
|
|
|
|
#{{{### Sudo Setup ###
|
|
|
|
echo -e "Sudo Setup
|
|
|
|
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 "
|
|
"
|
|
#}}}
|
|
|
|
#{{{### System Setup ###
|
|
|
|
echo -e "System Setup
|
|
|
|
Enter $username's Password:"
|
|
sudo bash "$script_path/system-setup/git-setup.sh" $system
|
|
if [[ $? != 0 ]]; then
|
|
exit 2
|
|
fi
|
|
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
|
|
"
|
|
#}}}
|
|
|
|
# {{{### Desktop Environment Setup ###
|
|
|
|
# }}}
|