Refactored helpers to reduce duplication and improve naming.
- Renamed chroot_install/chroot_enable to chroot_pacman_install/chroot_systemd_enable. - Made chroot_systemd_enable auto-print status, removing need for wrapper functions. - Used generic prompt helpers instead of duplicating logic in specialized functions. - Inlined and removed single-use wrapper functions throughout.
This commit is contained in:
@@ -33,32 +33,19 @@ NVIDIA_PACKAGES=(
|
||||
libva-nvidia-driver
|
||||
)
|
||||
|
||||
# Install Intel graphics drivers
|
||||
install_intel_graphics() {
|
||||
print "Installing Intel graphics drivers..."
|
||||
chroot_install "${INTEL_PACKAGES[@]}"
|
||||
}
|
||||
|
||||
# Install NVIDIA graphics drivers
|
||||
install_nvidia_graphics() {
|
||||
print "Installing NVIDIA graphics drivers..."
|
||||
chroot_install "${NVIDIA_PACKAGES[@]}"
|
||||
}
|
||||
|
||||
# Prompt user for graphics driver selection and install
|
||||
prompt_install_graphics() {
|
||||
print "Would you like to install graphics drivers? Type 'intel' exactly for Intel graphics drivers, 'nvidia' for NVIDIA graphics drivers, or anything else to skip."
|
||||
read -r driver
|
||||
prompt_menu "Would you like to install graphics drivers?" "Intel" "NVIDIA" "Skip"
|
||||
|
||||
case "$driver" in
|
||||
"intel")
|
||||
install_intel_graphics
|
||||
case "$MENU_SELECTION" in
|
||||
1)
|
||||
print "Installing Intel graphics drivers..."
|
||||
chroot_pacman_install "${INTEL_PACKAGES[@]}"
|
||||
;;
|
||||
"nvidia")
|
||||
install_nvidia_graphics
|
||||
;;
|
||||
*)
|
||||
print "Skipping graphics driver installation."
|
||||
2)
|
||||
print "Installing NVIDIA graphics drivers..."
|
||||
chroot_pacman_install "${NVIDIA_PACKAGES[@]}"
|
||||
;;
|
||||
*) print "Skipping graphics driver installation." ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -61,12 +61,7 @@ XFCE_PACKAGES=(
|
||||
|
||||
# Install XFCE base packages
|
||||
install_xfce_packages() {
|
||||
chroot_install "${XFCE_PACKAGES[@]}"
|
||||
}
|
||||
|
||||
# Enable LightDM display manager
|
||||
enable_lightdm() {
|
||||
chroot_enable lightdm.service
|
||||
chroot_pacman_install "${XFCE_PACKAGES[@]}"
|
||||
}
|
||||
|
||||
# Configure LightDM greeter
|
||||
@@ -109,7 +104,7 @@ install_xfce() {
|
||||
local username="$1"
|
||||
|
||||
install_xfce_packages
|
||||
enable_lightdm
|
||||
chroot_systemd_enable lightdm.service
|
||||
configure_lightdm
|
||||
copy_xfce_config "$username"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user