This commit is contained in:
JaKooLit
2025-02-27 20:44:57 +09:00
parent aae594ecff
commit bf44e13dac
2 changed files with 59 additions and 51 deletions

View File

@@ -31,4 +31,4 @@ for PKG1 in "${base[@]}"; do
install_package_pacman "$PKG1" "$LOG" install_package_pacman "$PKG1" "$LOG"
done done
echo -e "\nInstallation completed. Proceeding with AUR installations (if needed)..." printf "\n%.0s" {1..1}

View File

@@ -215,14 +215,17 @@ if lspci | grep -i "nvidia" &> /dev/null; then
whiptail --title "NVIDIA GPU Detected" --msgbox "NVIDIA GPU detected in your system.\n\nNOTE: The script will install nvidia-dkms, nvidia-utils, and nvidia-settings if you choose to configure." 12 60 whiptail --title "NVIDIA GPU Detected" --msgbox "NVIDIA GPU detected in your system.\n\nNOTE: The script will install nvidia-dkms, nvidia-utils, and nvidia-settings if you choose to configure." 12 60
fi fi
# Initialize the options command for whiptail checklist # Initialize the options array for whiptail checklist
options_command="whiptail --title 'Select Options' --checklist 'Choose options to install or configure\nNOTE: spacebar to select' 28 85 20" options_command=(
whiptail --title "Select Options" --checklist "Choose options to install or configure\nNOTE: spacebar to select" 28 85 20
)
# Add NVIDIA options to the checklist if NVIDIA GPU is detected # Add NVIDIA options if detected
if [ "$nvidia_detected" == "true" ]; then if [ "$nvidia_detected" == "true" ]; then
options_command+=" \ options_command+=(
'nvidia' 'Do you want script to configure NVIDIA GPU?' 'OFF' \ "nvidia" "Do you want script to configure NVIDIA GPU?" "OFF"
'nouveau' 'Do you want Nouveau to be blacklisted?' 'OFF' " "nouveau" "Do you want Nouveau to be blacklisted?" "OFF"
)
fi fi
# Check if user is already in the 'input' group # Check if user is already in the 'input' group
@@ -232,39 +235,45 @@ if ! groups "$(whoami)" | grep -q '\binput\b'; then
whiptail --title "Input Group" --msgbox "You are not currently in the input group.\n\nAdding you to the input group might be necessary for the Waybar keyboard-state functionality." 12 60 whiptail --title "Input Group" --msgbox "You are not currently in the input group.\n\nAdding you to the input group might be necessary for the Waybar keyboard-state functionality." 12 60
fi fi
# Add 'input_group' option if user is not in the 'input' group # Add 'input_group' option if necessary
if [ "$input_group_detected" == "true" ]; then if [ "$input_group_detected" == "true" ]; then
options_command+=" \ options_command+=(
'input_group' 'Add your USER to input group for some waybar functionality?' 'OFF' " "input_group" "Add your USER to input group for some waybar functionality?" "OFF"
)
fi fi
# Add the rest of your options here (including AUR helper option) # Add the remaining static options
options_command+=" \ options_command+=(
'gtk_themes' 'Install GTK themes (required for Dark/Light function)' 'OFF' \ "gtk_themes" "Install GTK themes (required for Dark/Light function)" "OFF"
'bluetooth' 'Do you want script to configure Bluetooth?' 'OFF' \ "bluetooth" "Do you want script to configure Bluetooth?" "OFF"
'thunar' 'Do you want Thunar file manager to be installed?' 'OFF' \ "thunar" "Do you want Thunar file manager to be installed?" "OFF"
'ags' 'Install AGS v1 for Desktop-Like Overview' 'OFF' \ "ags" "Install AGS v1 for Desktop-Like Overview" "OFF"
'sddm' 'Install & configure SDDM login manager?' 'OFF' \ "sddm" "Install & configure SDDM login manager?" "OFF"
'sddm_theme' 'Download & Install Additional SDDM theme?' 'OFF' \ "sddm_theme" "Download & Install Additional SDDM theme?" "OFF"
'xdph' 'Install XDG-DESKTOP-PORTAL-HYPRLAND (for screen share)?' 'OFF' \ "xdph" "Install XDG-DESKTOP-PORTAL-HYPRLAND (for screen share)?" "OFF"
'zsh' 'Install zsh shell with Oh-My-Zsh?' 'OFF' \ "zsh" "Install zsh shell with Oh-My-Zsh?" "OFF"
'pokemon' 'Add Pokemon color scripts to your terminal?' 'OFF' \ "pokemon" "Add Pokemon color scripts to your terminal?" "OFF"
'rog' 'Are you installing on Asus ROG laptops?' 'OFF' \ "rog" "Are you installing on Asus ROG laptops?" "OFF"
'dots' 'Download and install pre-configured KooL Hyprland dotfiles?' 'OFF'" "dots" "Download and install pre-configured KooL Hyprland dotfiles?" "OFF"
)
# Execute the options checklist and capture the selected options while true; do
selected_options=$(eval "$options_command" 3>&1 1>&2 2>&3) # Execute the checklist and capture the selected options
selected_options=$("${options_command[@]}" 3>&1 1>&2 2>&3)
# Check if the user pressed Cancel (exit status 1) # Check if the user pressed Cancel (exit status 1)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "${NOTE} - You cancelled the selection. ${YELLOW}Goodbye!${RESET}" echo " You cancelled the selection. Returning to selection..."
exit 1 continue # Go back to the selection menu instead of exiting
fi fi
# Clean up the selected options (remove quotes and trim spaces) # If no option was selected, notify and restart the selection
selected_options=$(echo "$selected_options" | tr -d '"' | tr -s ' ') if [ -z "$selected_options" ]; then
whiptail --title "Warning" --msgbox "⚠️ No options were selected. Please select at least one option." 10 60
continue # Return to selection
fi
# Convert selected options into an array # Convert selected options into an array (preserving spaces in values)
IFS=' ' read -r -a options <<< "$selected_options" IFS=' ' read -r -a options <<< "$selected_options"
# Prepare Confirmation Message # Prepare Confirmation Message
@@ -272,21 +281,20 @@ confirm_message="You have selected the following options:\n\n"
for option in "${options[@]}"; do for option in "${options[@]}"; do
confirm_message+=" - $option\n" confirm_message+=" - $option\n"
done done
confirm_message+="\nDo you want to proceed with these choices?" confirm_message+="\nDo you want to proceed with these choices?"
# Show Confirmation Dialog # Show the confirmation prompt
dialog --title "Confirm Your Choices" --yesno "$confirm_message" 20 80 if ! whiptail --title "Confirm Your Choices" --yesno "$(printf "%s" "$confirm_message")" 20 80; then
echo "❌ You cancelled the confirmation. Returning to selection..."
# If the user cancels, show the checklist again continue # Return to selection
if [ $? -ne 0 ]; then
echo "${NOTE} - You cancelled the confirmation. Returning to option selection..."
exec "$0"
fi fi
# If user confirms # If user confirms, break out of the loop and proceed
echo "${OK} - Proceeding with selected options..." break
done
# Proceed with installation
echo "${OK} - Proceeding with selected options..."
# Ensuring base-devel is installed # Ensuring base-devel is installed
execute_script "00-base.sh" execute_script "00-base.sh"