Rework Part 1

This commit is contained in:
2025-03-13 12:39:54 +01:00
parent 8c454d6076
commit df8bfc3e75
8 changed files with 924 additions and 202 deletions

266
debian-setup.sh Normal file
View File

@@ -0,0 +1,266 @@
#!/bin/bash
# Function name: Install packages
# Description: Install packages from an array
# Arguments:
# $1: Package list (array)
install_packages() {
local packages=("${!1}")
for package in "${packages[@]}"; do
sudo apt-get install -y "$package"
done
}
# Function name: Add repositories
# Description: Add repositories from an array
# Arguments:
# $1: Repository list (array)
add_repositories() {
options=(
"debian" "Debian official repository" ON
"brave" "Brave official repository" OFF
"chrome" "Google Chrome official repository" OFF
"edge" "Microsoft Edge official repository" OFF
"librewolf" "Librewolf official repository" OFF
"mullvad" "Mullvad official repository" OFF
"waydroid" "Waydroid official repository" OFF
)
selected_repositories=$(whiptail --title "Add Repositories" --checklist \
"Choose the repositories you want to add:" 20 78 3 \
"${options[@]}" 3>&1 1>&2 2>&3)
for repository in $selected_repositories; do
case $repository in
"debian")
sudo add-apt-repository main
;;
"brave")
sudo apt install apt-transport-https curl -y
sudo curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | sudo apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add -
echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
;;
"chrome")
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
;;
"edge")
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge.list'
;;
"librewolf")
sudo apt install extrepo -y
sudo extrepo enable librewolf
;;
"mullvad")
sudo curl -fsSLo /usr/share/keyrings/mullvad-keyring.asc https://repository.mullvad.net/deb/mullvad-keyring.asc
echo "deb [signed-by=/usr/share/keyrings/mullvad-keyring.asc arch=$( dpkg --print-architecture )] https://repository.mullvad.net/deb/stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mullvad.list
;;
"waydroid")
sudo apt install curl ca-certificates -y
curl -s https://repo.waydro.id | sudo bash
;;
esac
done
}
# Function name: Update system
# Description: Update the system
update_system() {
sudo apt-get update
sudo apt-get upgrade -y
}
# Function name: Setup plymouth
# Description: Setup plymouth
setup_plymouth() {
sudo apt-get install -y plymouth plymouth-themes
sudo plymouth-set-default-theme -R spinner
}
# Packages group definitions
zsh_packages=(
zsh
zsh-autosuggestions
zsh-syntax-highlighting
)
games_packages=(
steam-installer
)
pipewire_packages=(
pipewire
pipewire-audio-client-libraries
pipewire-pulse
pipewire-jack
pipewire-alsa
wireplumber
)
cups_packages=(
cups
cups-filters
system-config-printer
)
networkmanager_packages=(
network-manager
network-manager-openvpn
network-manager-pptp
network-manager-vpnc
network-manager-strongswan
network-manager-l2tp
wpasupplicant
)
bluetooth_packages=(
bluez
bluez-tools
blueman
)
virtualization_packages=(
qemu-kvm
libvirt-daemon-system
libvirt-clients
virt-manager
virt-viewer
swtpm
)
containers_packages=(
podman
distrobox
waydroid
lxc
)
# Function name: Setup browser
# Description: Setup browser
setup_browser() {
options=(
"Firefox" "Install Firefox" ON
"Chromium" "Install Chromium" OFF
"Brave" "Install Brave" OFF
"Google Chrome" "Install Google Chrome" OFF
"Tor Browser" "Install Tor Browser" OFF
"Mullvad Browser" "Install Mullvad Browser" OFF
"Edge Stable" "Install Edge Stable" OFF
"LibreWolf" "Install LibreWolf" OFF
"Links" "Install Links" OFF
)
selected_browsers=$(whiptail --title "Setup Browser" --checklist \
"Choose the browsers you want to install:" 20 78 9 \
"${options[@]}" 3>&1 1>&2 2>&3)
for browser in $selected_browsers; do
case $browser in
"\"Firefox\"")
sudo apt-get install -y firefox-esr
;;
"\"Chromium\"")
sudo apt-get install -y chromium
;;
"\"Brave\"")
sudo apt-get install -y brave-browser
;;
"\"Google Chrome\"")
sudo apt-get install -y google-chrome-stable
;;
"\"Tor Browser\"")
sudo apt-get install -y torbrowser-launcher
;;
"\"Mullvad Browser\"")
sudo apt-get install -y mullvad-browser
;;
"\"Edge Stable\"")
sudo apt-get install -y microsoft-edge-stable
;;
"\"LibreWolf\"")
sudo apt-get install -y librewolf
;;
"\"Links\"")
sudo apt-get install -y links
;;
esac
done
}
# Function name: Setup U2F
# Description: Setup U2F
setup_u2f() {
sudo apt-get install -y libpam-u2f
mkdir -p ~/.config/Yubico
pamu2fcfg > ~/.config/Yubico/u2f_keys
echo "auth required pam_u2f.so" | sudo tee -a /etc/pam.d/common-auth
}
# Function name: Setup OpenRGB
# Description: Setup OpenRGB
setup_openrgb() {
sudo apt-get install -y openrgb
sudo gpasswd -a "$USER" plugdev
sudo systemctl enable --now openrgb
}
# Function name: Install packages group
# Description: Install packages group by asking with a selection menu which group would you like to install
install_packages_group() {
options=(
"Zsh" "Install Zsh packages" OFF
"Theme" "Install Theme packages" OFF
"Games" "Install Games packages" OFF
"Pipewire" "Install Pipewire packages" OFF
"Cups" "Install Cups packages" OFF
"NetworkManager" "Install NetworkManager packages" OFF
"Bluetooth" "Install Bluetooth packages" OFF
"Virtualization" "Install Virtualization packages" OFF
"Containers" "Install Containers packages" OFF
"U2F" "Setup U2F" OFF
"OpenRGB" "Setup OpenRGB" OFF
)
selected_groups=$(whiptail --title "Install Packages Group" --checklist \
"Choose the packages group you want to install:" 20 78 11 \
"${options[@]}" 3>&1 1>&2 2>&3)
for group in $selected_groups; do
case $group in
"\"Zsh\"")
install_packages zsh_packages[@]
;;
"\"Theme\"")
install_packages theme_packages[@]
;;
"\"Games\"")
install_packages games_packages[@]
;;
"\"Pipewire\"")
install_packages pipewire_packages[@]
;;
"\"Cups\"")
install_packages cups_packages[@]
;;
"\"NetworkManager\"")
install_packages networkmanager_packages[@]
;;
"\"Bluetooth\"")
install_packages bluetooth_packages[@]
;;
"\"Virtualization\"")
install_packages virtualization_packages[@]
;;
"\"Containers\"")
install_packages containers_packages[@]
;;
"\"U2F\"")
setup_u2f
;;
"\"OpenRGB\"")
setup_openrgb
;;
esac
done
}
# Main script
update_system
setup_plymouth
setup_browser
install_packages_group