Compare commits

...

3 commits

Author SHA1 Message Date
Rodolfo a6ac1d7850 Update Readme 2024-06-29 03:14:13 +08:00
Rodolfo 11bc672f97 Complete system setup part of script 2024-06-29 03:13:14 +08:00
Rodolfo 3f93fd90de Deleted install pkgs script 2024-06-29 03:11:44 +08:00
12 changed files with 288 additions and 182 deletions

View file

@ -162,3 +162,31 @@ Window Manager that I personally prefer.
- Thunderbird (Maybe) - Thunderbird (Maybe)
- AWSCLI - AWSCLI
- Requires Python - Requires Python
<!--
**Packages:**
Variables:
Window Manager/Compositor/Display Server
- i3wm/picom/xorg
- awesome/picom/xorg
- hyprland/wayland
GPU Drivers
- nvidia-driver
Setup:
sudo
git
bashcompletion
GPU Drivers
ufw
Desktop:
Window Manager
sddm
Users:
Process Design
Setup script
-->

View file

@ -0,0 +1,8 @@
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates main contrib nonfree non-free-firmware

View file

@ -0,0 +1,15 @@
#!/bin/bash
# Setup Audio Drivers
if [[ $1 == "Debian" ]]; then
if [[ $2 == "pipewire" ]]; then
echo "apt-get -y install pipewire-audio"
fi
if [[ $2 == "pulseaudio" ]]; then
echo "Skipping: No further action required"
fi
fi
if [[ $1 == "Arch" ]]; then
echo "audio setup"
fi

View file

@ -1,19 +1,36 @@
#!/bin/bash #!/bin/bash
home_dir="/home/""$(ls /home/)" # Set Home directory for the current user
repos_dir=/home/$1/Repos
if [[ -d $home_dir ]]; then if [[ ! -d $repos_dir ]]; then
echo "Has valid home directory" echo "mkdir $repos_dir"
while [[ true ]]; do
if [[ -d $home_dir/Repos ]]; then
echo "Has valid Repos directory"
read -p "Enter your dotfiles repo: " repo
echo "git clone $repo $home_dir/Repos"
break
else
mkdir $home_dir/Repos
fi
done
else
echo "no valid home directory"
fi fi
if [[ ! -d /home/$1/.config ]]; then
echo "mkdir /home/$1/.config"
fi
while true; do
read -p "Do you have a dotfiles repository you would like to clone? (y/n): " answer
answer="${answer,,}"
if [[ $answer == "y" ]]; then
while true; do
read -p "Enter your dotfiles repo (<branch> <url>): " repo
echo "git clone -b $repo $repos_dir/dotfiles"
if [[ $? = 0 ]]; then
for file in $repos_dir/dotfiles/*; do
echo "ln -s $file /home/$1/.config/"
done
break
else
echo "Invalid Repo or Authentication"
fi
done
break
elif [[ $answer == "n" ]]; then
echo "Skipping dotfiles setup..."
break
else
echo "Invalid Input. Please enter 'y' or 'n'"
fi
done

View file

@ -1,24 +1,9 @@
#!/bin/bash #!/bin/bash
if [[ $1 == "Debian" ]]; then if [[ $1 == "Debian" ]]; then
echo "$1 git-setup" echo "$1 git-setup"
echo "apt-get install git" echo "apt-get -y install git"
elif [[ $1 == "Arch" ]]; then elif [[ $1 == "Arch" ]]; then
echo "$1 git-setup" echo "$1 git-setup"
echo "pacman -S git" echo "pacman -S git"
while [[ true ]]; do
read -p "Git Setup: Enter your full name: " name
read -p "Git Setup: Enter your email address: " email
if [[ ! -z $name && ! -z $email ]]; then
break
else
echo "Invalid name or address, Please re-enter"
fi
done
echo "git config --global user.name $name"
echo "git config --global user.email $email"
fi fi

View file

@ -0,0 +1,27 @@
#!/bin/bash
if [[ $1 == "Debian" ]]; then
if cat /etc/apt/sources.list | grep -E "sid|unstable"; then
if [[ $3 == "xorg" ]]; then
echo "apt-get -y install xorg"
fi
if [[ $3 == "wayland" ]]; then
echo "Error: Wayland not available on Debian"
exit 2
fi
if [[ $2 == "vm" ]]; then
echo "Skipping: No further action required"
fi
if [[ $2 == "nvidia" ]]; then
echo "apt-get -y install nvidia-driver firmware-misc-nonfree"
fi
else
if [[$2 == "nvidia" ]]; then
echo "apt-get -y install nvidia-driver firmware-misc-nonfree"
fi
fi
fi
if [[ $1 == "Arch" ]]; then
echo "gpu setup"
fi

View file

@ -1,69 +0,0 @@
#!/bin/bash
if [[ $1 == "Debian" ]]; then
# Setup sources
echo "$1 Sources Setup"
echo "apt-get update && apt-get -y upgrade"
while true; do
read -rp "Would you like to use Debian Unstable? (y/n): " answer
answer="${answer,,}"
if [[ "$answer" = "y" ]]; then
echo "Changing apt sources"
echo "cp -v ./debian-assets/debian-sid-sources.list /etc/apt/sources.list"
echo "apt-get update && apt-get -y dist-upgrade"
break
elif [[ "$answer" = "n" ]]; then
echo "Proceeding with Debian Stable"
break
else
echo "Invalid Input. Please enter 'y' or 'n'."
fi
done
# Sudo Setup
echo "$1 Sudo Setup"
echo "apt-get -y install sudo"
while true; do
if [[ ! -z $(grep $2 /etc/passwd) ]]; then
echo "usermod -aG sudo $2"
break
else
read -p "Invalid Username. Use an valid existing username." username
fi
done
echo "apt-get -y install "
fi
if [[ $1 == "Arch" ]]; then
# Setup Sources
echo "$1 Sources Setup"
echo "$1 Sudo Setup"
fi
if [[ $1 == "Debian" ]]; then
elif [[ $1 == "Arch" ]]; then
echo "$1 Sudo Setup"
while true; do
if [[ ! -z $(grep $2 /etc/passwd) ]]; then
echo "usermod -aG wheel $2"
if [[ -f /home/$2/ ]]; then
echo "Home exists"
else
echo "Home doesn't Exist"
fi
break
else
read -p "Invalid Username. Use a valid existing username:" username
fi
done
fi

View file

@ -0,0 +1,15 @@
#!/bin/bash
if [[ ! -d /home/$2/Software ]]; then
echo "mkdir /home/$2/Software"
fi
if [[ $1 == "Debian" ]]; then
echo "sudo apt-get -y install fzf ripgrep ninja-build gettext cmake unzip curl build-essential"
echo "git clone -b stable https://github.com/neovim/neovim /home/$2/Software"
echo "cd /home/$2/Software/neovim/ && make CMAKE_BUILD_TYPE=RelWithDebInfo && cd build && cpack -G DEB && sudo dpkg -i nvim-linux64.deb"
fi
if [[ $1 == "Arch" ]]; then
echo "pacman -S neovim"
fi

View file

@ -14,6 +14,8 @@ if [[ $1 == "Debian" ]]; then
break break
elif [[ "$answer" = "n" ]]; then elif [[ "$answer" = "n" ]]; then
echo "Proceeding with Debian Stable" echo "Proceeding with Debian Stable"
echo "cp -v ./debian-assets/debian-stable-sources.list /etc/apt/sources.list"
echo "apt-get update && apt-get -y dist-upgrade"
break break
else else
echo "Invalid Input. Please enter 'y' or 'n'." echo "Invalid Input. Please enter 'y' or 'n'."

View file

@ -2,36 +2,23 @@
if [[ $1 == "Debian" ]]; then if [[ $1 == "Debian" ]]; then
echo "$1 Sudo Setup" if [[ ! -z $(grep $2 /etc/passwd) ]]; then
while [[ true ]]; do echo "usermod -aG sudo $2"
if [[ ! -z $(grep $2 /etc/passwd) ]]; then else
echo "usermod -aG sudo $2" echo "Username is Invalid"
if [[ -f /home/$2/ ]]; then exit 1
echo "Home exists" fi
else
echo "Home doesn't Exist" fi
fi
break if [[ $1 == "Arch" ]]; then
else
read -p "Invalid Username. Use an valid existing username." username if [[ ! -z $(grep $2 /etc/passwd) ]]; then
fi echo "usermod -aG wheel $2"
done break
else
elif [[ $1 == "Arch" ]]; then echo "Username is Invalid"
exit 1
echo "$1 Sudo Setup" fi
while [[ true ]]; do
if [[ ! -z $(grep $2 /etc/passwd) ]]; then
echo "usermod -aG wheel $2"
if [[ -f /home/$2/ ]]; then
echo "Home exists"
else
echo "Home doesn't Exist"
fi
break
else
read -p "Invalid Username. Use a valid existing username:" username
fi
done
fi fi

View file

@ -0,0 +1,13 @@
#!/bin/bash
if [[ $1 == "Debian" ]];then
echo "apt-get -y install ufw"
fi
if [[$1 == "Arch" ]];then
echo "ufw setup"
fi
echo "ufw default deny incoming"
echo "ufw default allow outgoing"
echo "ufw allow ssh"

View file

@ -1,70 +1,148 @@
#!/bin/bash #!/bin/bash
# Parent installer for all System Setup Scripts. #{{{### Pre-Setup ###
# Select Window Manager # User Identification
while true; do username=$(whoami)
printf %"s\n\n" "Window Manager Selection(1-3):" if [[ $username == "root" ]]; then
printf %"s\n" "1) i3wm" echo "Do not run this script as root"
printf %"s\n" "2) AwesomeWM" exit 2
printf %"s\n\n" "3) Hyprland" fi
read -p "Enter your Selection: " answer
case $answer in # Verify Home Directory
1) windowmanager=i3wm && break;; home_dir=/home/$username
2) windowmanager=awesomewm && break;; if [[ ! -d /home/$username ]]; then
3) windowmanager=hyprland && break;; echo "Error: No valid home directory for $username"
*) echo "invalid option";; exit 2
esac fi
done
# Select Graphics Drivers # System Identification
while true; do if [[ -d /etc/apt/ ]]; then
printf %"s\n\n" "Select Graphics Environment(1-6):"
printf %"s\n" "1) Nvidia GPU Proprietary"
printf %"s\n" "2) Nvidia GPU Nouveau"
printf %"s\n" "3) AMD GPU"
printf %"s\n" "4) Integrated Intel GPU"
printf %"s\n" "5) Integrated AMD GPU"
printf %"s\n\n" "6) Virtual Box"
read -p "Enter your Selection: " answer
case $answer in
1) GPUDriver=hyprland && break;;
2) GPUDriver=hyprland && break;;
3) GPUDriver=hyprland && break;;
4) GPUDriver=hyprland && break;;
5) GPUDriver=hyprland && break;;
6) GPUDriver=hyprland && break;;
*) echo "invalid option";;
esac
done
echo "$GPUDriver"
if [[ ! -z $(which apt-get) ]]; then
system=Debian system=Debian
echo "System Identified: $system" echo "System Identified: $system"
elif [[ ! -z $(which pacman) ]]; then elif [[ ! -z $(which pacman) ]]; then
system=Arch system=Arch
echo "System Identified: $system" echo "System Identified: $system"
else else
echo "System Misconfigured" echo "System could not Identified"
break exit 2
fi fi
script_path="$(pwd)/scripts"
# Window Manager Selection
if [[ $system == "Debian" ]]; then
echo -ne "
Window Manager Selection:
script_path="$(pwd)/scripts/system-setup/" "
username=$(whoami) printf %"s\n" "1) i3wm"
printf %"s\n\n" "2) AwesomeWM"
while true; do
read -p "Enter your Selection (1-2): " answer
if [ $username == "root" ]; then case $answer in
echo "Error: Do not run script as root." 1) windowmanager=i3wm && displayserver=xorg && break;;
break 2) windowmanager=awesomewm && displayserver=xorg && break;;
*) echo "invalid option";;
esac
done
fi fi
echo "su - -c "$script_path/install-pkgs.sh $system $username"" if [[ $system == "Arch" ]]; then
echo "su - -c "$script_path/sources-setup.sh $system && $script_path/sudo-setup.sh $system $username && $script_path/git-setup.sh $system"" echo -ne "
echo "bash $script_path/dotfiles-setup.sh $system" Window Manager Selection:
echo "done" "
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 ###
# }}}