Fixes and updates

This commit is contained in:
2025-05-16 11:51:43 +02:00
parent 119ab1675e
commit 6150b37ae2
2 changed files with 63 additions and 39 deletions

View File

@@ -12,7 +12,7 @@ install_packages() {
} }
# Function name: Install package # Function name: Install package
# Description: Install a package # Description: Install a package given its name
# Arguments: # Arguments:
# $1: Package name # $1: Package name
install_package() { install_package() {
@@ -20,7 +20,7 @@ install_package() {
} }
# Function name: Install dependencies # Function name: Install dependencies
# Description: Install dependencies # Description: Install package as dependency given its name
# Arguments: # Arguments:
# $1: Package name # $1: Package name
install_dependencies() { install_dependencies() {
@@ -35,14 +35,14 @@ check_whiptail() {
fi fi
} }
# Function name: Add repositories # Function name: Setup repositories
# Description: Ask the user if they want to add specific repositories # Description: Ask the user if they want to add specific repositories
add_repositories() { setup_repositories() {
options=( options=(
"CachyOS" "Add CachyOS repository" OFF "CachyOS" "Add CachyOS repository - x86 -v3 and -v4 optimized, custom and some AUR packages" OFF
"Chromatic" "Add Chromatic repository" ON "Chromatic" "Add Chromatic repository - prebuilt AUR packages not in Chaotic.cx" ON
"BlackArch" "Add BlackArch repository" OFF "BlackArch" "Add BlackArch repository - hacking related packages" OFF
"Chaotic.cx" "Add Chaotic.cx repository" ON "Chaotic.cx" "Add Chaotic.cx repository - prebuilt AUR packages (Recommended)" ON
) )
selected_repos=$(whiptail --title "Add Repositories" --checklist \ selected_repos=$(whiptail --title "Add Repositories" --checklist \
@@ -120,9 +120,9 @@ setup_pacman() {
} }
# Function name: GPU setup # Function name: Setup GPU
# Description: Setup GPU depending on the available devices # Description: Setup GPU depending on the available devices
gpu_setup() { setup_gpu() {
if whiptail --title "Setup GPU" --yesno "Would you like to setup GPU?" 10 60; then if whiptail --title "Setup GPU" --yesno "Would you like to setup GPU?" 10 60; then
detected_gpu=$(lspci | grep -Ei "vga|3d|display") detected_gpu=$(lspci | grep -Ei "vga|3d|display")
case "$detected_gpu" in case "$detected_gpu" in
@@ -183,7 +183,7 @@ gpu_setup() {
# Function name: Setup plymouth # Function name: Setup plymouth
# Description: Setup plymouth # Description: Install and setup Plymouth for boot splash
setup_plymouth() { setup_plymouth() {
if whiptail --title "Setup Plymouth" --yesno "Would you like to setup Plymouth?" 10 60; then if whiptail --title "Setup Plymouth" --yesno "Would you like to setup Plymouth?" 10 60; then
echo "quiet splash" | sudo tee -a /etc/kernel/cmdline echo "quiet splash" | sudo tee -a /etc/kernel/cmdline
@@ -286,13 +286,16 @@ containers_packages=(
) )
thunderbird_packages=( thunderbird_packages=(
thunderbird thunderbird
thunderbird-i18n-en-us
thunderbird-dark-reader thunderbird-dark-reader
thunderbird-ublock-origin thunderbird-ublock-origin
) )
developer_packages=(
git
visual-studio-code-bin
)
# function name : setup browser # function name : setup browser
# Description: setup browser # Description: Ask the user which browsers they want to install
setup_browser() { setup_browser() {
options=( options=(
"Firefox" "Install Firefox" ON "Firefox" "Install Firefox" ON
@@ -360,7 +363,7 @@ setup_browser() {
} }
# function name : setup u2f # function name : setup u2f
# Description: setup u2f # Description: setup pam-u2f for login using Yubikey
setup_u2f() { setup_u2f() {
install_package pam-u2f install_package pam-u2f
mkdir ~/.config/Yubico mkdir ~/.config/Yubico
@@ -375,12 +378,38 @@ setup_u2f() {
sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/sudo sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/sudo
sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/passwd sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/passwd
sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/system-login sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/system-login
sudo cp /usr/lib/pam.d/polkit-1 /etc/pam.d/polkit-1 if [ ! -f /etc/pam.d/polkit-1 ]; then
sudo cp /usr/lib/pam.d/polkit-1 /etc/pam.d/polkit-1
fi
sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/polkit-1 sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/polkit-1
} }
# function name : setup fprint
# Description: setup fprint for login using fingerprint reader
setup_fprint() {
install_package fprintd
install_dependencies imagemagick
sudo systemctl enable --now fprintd
sudo sed -i '/^auth\s*include\s*system-login/i auth [success=1 default=ignore] pam_succeed_if.so service in sudo:su:su-l tty in :unknown' /etc/pam.d/system-local-login
sudo sed -i '/^auth\s*include\s*system-login/i auth sufficient pam_fprintd.so' /etc/pam.d/system-local-login
if [ ! -f /etc/pam.d/polkit-1 ]; then
sudo cp /usr/lib/pam.d/polkit-1 /etc/pam.d/polkit-1
fi
sudo sed -i '/^auth\s*include\s*system-auth/i auth include u2f-sufficient' /etc/pam.d/polkit-1
fprintd-enroll
}
# function name : setup SmartCard [WIP]
# Description: setup pcscd for login using smartcard reader
setup_smartcard() {
install_package pcscd
install_dependencies pcsc-tools
sudo systemctl enable --now pcscd
sudo systemctl enable --now pcscd.socket
}
# function name : setup OpenRGB # function name : setup OpenRGB
# Description: setup OpenRGB # Description: Install OpenRGB for RGB devices control
setup_openrgb() { setup_openrgb() {
install_package openrgb install_package openrgb
sudo gpasswd -a "$USER" plugdev sudo gpasswd -a "$USER" plugdev
@@ -388,7 +417,7 @@ setup_openrgb() {
} }
# function name : Install packages group # function name : Install packages group
# Description: Install packages group by asking with a selection menu which group would you like to install # Description: Install packages group by asking user with a selection menu which group would they like to install
install_packages_group() { install_packages_group() {
options=( options=(
"Zsh" "Install Zsh packages" OFF "Zsh" "Install Zsh packages" OFF
@@ -403,19 +432,21 @@ install_packages_group() {
"Virtualization" "Install Virtualization packages" OFF "Virtualization" "Install Virtualization packages" OFF
"Containers" "Install Containers packages" OFF "Containers" "Install Containers packages" OFF
"U2F" "Setup U2F" OFF "U2F" "Setup U2F" OFF
"Fprint" "Setup Fprint" OFF
"OpenRGB" "Setup OpenRGB" OFF "OpenRGB" "Setup OpenRGB" OFF
"Thunderbird" "Install Thunderbird" OFF "Thunderbird" "Install Thunderbird" OFF
"Developer" "Install Developer packages" OFF
) )
selected_groups=$(whiptail --title "Install Packages Group" --checklist \ selected_groups=$(whiptail --title "Install Packages Group" --checklist \
"Choose the packages group you want to install:" 20 78 13 \ "Choose the packages group you want to install:" 20 78 15 \
"${options[@]}" 3>&1 1>&2 2>&3) "${options[@]}" 3>&1 1>&2 2>&3)
for group in $selected_groups; do for group in $selected_groups; do
case $group in case $group in
"\"Zsh\"") "\"Zsh\"")
install_packages zsh_packages[@] install_packages zsh_packages[@]
if (whiptail --title "Change default shell to Zsh" --yesno "Would you like to change the default shell to Zsh?" 10 60) then if (whiptail --title "Change default shell to Zsh" --yesno "Would you like to change the default shell to Zsh?" 10 60); then
chsh -s /bin/zsh chsh -s /bin/zsh
fi fi
;; ;;
@@ -452,18 +483,24 @@ install_packages_group() {
"\"U2F\"") "\"U2F\"")
setup_u2f setup_u2f
;; ;;
"\"Fprint\"")
setup_fprint
;;
"\"OpenRGB\"") "\"OpenRGB\"")
setup_openrgb setup_openrgb
;; ;;
"\"Thunderbird\"") "\"Thunderbird\"")
install_packages thunderbird_packages[@] install_packages thunderbird_packages[@]
;;
"\"Developer\"")
install_packages developer_packages[@]
;; ;;
esac esac
done done
} }
# function name : setup_firewall # function name : setup_firewall
# Description: setup firewall # Description: Install and setup user selected firewall
setup_firewall() { setup_firewall() {
options=( options=(
"ufw" "Install UFW" ON "ufw" "Install UFW" ON
@@ -495,7 +532,7 @@ setup_firewall() {
} }
# function name : setup_flatpak # function name : setup_flatpak
# Description: setup flatpak # Description: Install and setup Flatpak and Flathub
setup_flatpak() { setup_flatpak() {
if whiptail --title "Setup Flatpak" --yesno "Would you like to setup Flatpak?" 10 60; then if whiptail --title "Setup Flatpak" --yesno "Would you like to setup Flatpak?" 10 60; then
install_package flatpak install_package flatpak
@@ -562,13 +599,13 @@ setup_office_suite() {
# Main script # Main script
check_whiptail check_whiptail
add_repositories setup_repositories
update_system update_system
setup_pacman setup_pacman
setup_browser setup_browser
install_packages_group install_packages_group
setup_plymouth setup_plymouth
gpu_setup setup_gpu
setup_firewall setup_firewall
setup_flatpak setup_flatpak
setup_fwupd setup_fwupd

View File

@@ -15,7 +15,7 @@ fi
if ! command -v podman &>/dev/null && ! command -v docker &>/dev/null; then if ! command -v podman &>/dev/null && ! command -v docker &>/dev/null; then
CHOICE=$(whiptail --title "Container Engine" --menu "Choose a container engine to install" 15 60 2 \ CHOICE=$(whiptail --title "Container Engine" --menu "Choose a container engine to install" 15 60 2 \
"docker" "Docker" \ "docker" "Docker" \
"podman" "Podman" 3>&1 1>&2 2>&3) "podman" "Podman (Recommended)" 3>&1 1>&2 2>&3)
case $CHOICE in case $CHOICE in
docker) docker)
@@ -99,12 +99,12 @@ for CHOICE in $CHOICES; do
distrobox-create --yes --name almalinux \ distrobox-create --yes --name almalinux \
--image docker.io/library/almalinux:latest --init --pull --nvidia \ --image docker.io/library/almalinux:latest --init --pull --nvidia \
--home /home/"$USER"/distrobox/almalinux \ --home /home/"$USER"/distrobox/almalinux \
--additional-packages "systemd sudo git zsh nano wget curl fastfetch" --additional-packages "systemd sudo git zsh nano wget curl"
else else
distrobox-create --yes --name almalinux \ distrobox-create --yes --name almalinux \
--image docker.io/library/almalinux:latest --init --pull \ --image docker.io/library/almalinux:latest --init --pull \
--home /home/"$USER"/distrobox/almalinux \ --home /home/"$USER"/distrobox/almalinux \
--additional-packages "systemd sudo git zsh nano wget curl fastfetch" --additional-packages "systemd sudo git zsh nano wget curl"
fi fi
;; ;;
opensuse-tumbleweed) opensuse-tumbleweed)
@@ -120,19 +120,6 @@ for CHOICE in $CHOICES; do
--additional-packages "systemd sudo git zsh nano wget curl fastfetch" --additional-packages "systemd sudo git zsh nano wget curl fastfetch"
fi fi
;; ;;
steamos)
if lspci | grep -i nvidia &>/dev/null; then
distrobox-create --yes --name steamos \
--image ghcr.io/linuxserver/steamos:latest --init --pull --nvidia \
--home /home/"$USER"/distrobox/steamos \
--additional-packages "systemd sudo git zsh nano wget curl fastfetch"
else
distrobox-create --yes --name steamos \
--image ghcr.io/linuxserver/steamos:latest --init --pull \
--home /home/"$USER"/distrobox/steamos \
--additional-packages "systemd sudo git zsh nano wget curl fastfetch"
fi
;;
void) void)
if lspci | grep -i nvidia &>/dev/null; then if lspci | grep -i nvidia &>/dev/null; then
distrobox-create --yes --name void \ distrobox-create --yes --name void \