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
# Description: Install a package
# Description: Install a package given its name
# Arguments:
# $1: Package name
install_package() {
@@ -20,7 +20,7 @@ install_package() {
}
# Function name: Install dependencies
# Description: Install dependencies
# Description: Install package as dependency given its name
# Arguments:
# $1: Package name
install_dependencies() {
@@ -35,14 +35,14 @@ check_whiptail() {
fi
}
# Function name: Add repositories
# Function name: Setup repositories
# Description: Ask the user if they want to add specific repositories
add_repositories() {
setup_repositories() {
options=(
"CachyOS" "Add CachyOS repository" OFF
"Chromatic" "Add Chromatic repository" ON
"BlackArch" "Add BlackArch repository" OFF
"Chaotic.cx" "Add Chaotic.cx repository" ON
"CachyOS" "Add CachyOS repository - x86 -v3 and -v4 optimized, custom and some AUR packages" OFF
"Chromatic" "Add Chromatic repository - prebuilt AUR packages not in Chaotic.cx" ON
"BlackArch" "Add BlackArch repository - hacking related packages" OFF
"Chaotic.cx" "Add Chaotic.cx repository - prebuilt AUR packages (Recommended)" ON
)
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
gpu_setup() {
setup_gpu() {
if whiptail --title "Setup GPU" --yesno "Would you like to setup GPU?" 10 60; then
detected_gpu=$(lspci | grep -Ei "vga|3d|display")
case "$detected_gpu" in
@@ -183,7 +183,7 @@ gpu_setup() {
# Function name: Setup plymouth
# Description: Setup plymouth
# Description: Install and setup Plymouth for boot splash
setup_plymouth() {
if whiptail --title "Setup Plymouth" --yesno "Would you like to setup Plymouth?" 10 60; then
echo "quiet splash" | sudo tee -a /etc/kernel/cmdline
@@ -286,13 +286,16 @@ containers_packages=(
)
thunderbird_packages=(
thunderbird
thunderbird-i18n-en-us
thunderbird-dark-reader
thunderbird-ublock-origin
)
developer_packages=(
git
visual-studio-code-bin
)
# function name : setup browser
# Description: setup browser
# Description: Ask the user which browsers they want to install
setup_browser() {
options=(
"Firefox" "Install Firefox" ON
@@ -360,7 +363,7 @@ setup_browser() {
}
# function name : setup u2f
# Description: setup u2f
# Description: setup pam-u2f for login using Yubikey
setup_u2f() {
install_package pam-u2f
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/passwd
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
}
# 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
# Description: setup OpenRGB
# Description: Install OpenRGB for RGB devices control
setup_openrgb() {
install_package openrgb
sudo gpasswd -a "$USER" plugdev
@@ -388,7 +417,7 @@ setup_openrgb() {
}
# 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() {
options=(
"Zsh" "Install Zsh packages" OFF
@@ -403,19 +432,21 @@ install_packages_group() {
"Virtualization" "Install Virtualization packages" OFF
"Containers" "Install Containers packages" OFF
"U2F" "Setup U2F" OFF
"Fprint" "Setup Fprint" OFF
"OpenRGB" "Setup OpenRGB" OFF
"Thunderbird" "Install Thunderbird" OFF
"Developer" "Install Developer packages" OFF
)
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)
for group in $selected_groups; do
case $group in
"\"Zsh\"")
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
fi
;;
@@ -452,18 +483,24 @@ install_packages_group() {
"\"U2F\"")
setup_u2f
;;
"\"Fprint\"")
setup_fprint
;;
"\"OpenRGB\"")
setup_openrgb
;;
"\"Thunderbird\"")
install_packages thunderbird_packages[@]
;;
"\"Developer\"")
install_packages developer_packages[@]
;;
esac
done
}
# function name : setup_firewall
# Description: setup firewall
# Description: Install and setup user selected firewall
setup_firewall() {
options=(
"ufw" "Install UFW" ON
@@ -495,7 +532,7 @@ setup_firewall() {
}
# function name : setup_flatpak
# Description: setup flatpak
# Description: Install and setup Flatpak and Flathub
setup_flatpak() {
if whiptail --title "Setup Flatpak" --yesno "Would you like to setup Flatpak?" 10 60; then
install_package flatpak
@@ -562,13 +599,13 @@ setup_office_suite() {
# Main script
check_whiptail
add_repositories
setup_repositories
update_system
setup_pacman
setup_browser
install_packages_group
setup_plymouth
gpu_setup
setup_gpu
setup_firewall
setup_flatpak
setup_fwupd