Skip to content

Commit e03af8e

Browse files
authored
Update autoinstallpackages.sh
1 parent 8b261a7 commit e03af8e

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

autoinstallpackages.sh

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,20 @@ echo -e "${YELLOW}Checking if the system is running Arch Linux...${NC}"
5353
if [[ ! -f /etc/os-release ]] || ! grep -q "Arch Linux" /etc/os-release; then
5454
error_exit "Error: this script is only intended for Arch Linux."
5555
fi
56-
success "Arch Linux detected. Proceeding..."
56+
success "Arch Linux detected. Proceeding…"
57+
58+
# Detect if the system has a GPU and install the appropriate drivers
59+
echo -e "${YELLOW}Detecting GPU type...${NC}"
60+
GPU_INFO=$(lspci | grep -i "vga\|3d")
61+
if echo "$GPU_INFO" | grep -iq "amd"; then
62+
info "AMD GPU detected. Adding vulkan-radeon to the package list..."
63+
packages_pacman+=("vulkan-radeon" "lib32-vulkan-radeon")
64+
elif echo "$GPU_INFO" | grep -iq "nvidia"; then
65+
info "NVIDIA GPU detected. Adding nouveau and nvidia-dkms to the package list..."
66+
packages_pacman+=("xf86-video-nouveau" "nvidia-open-dkms" "lib32-nvidia-utils")
67+
else
68+
info "No compatible discrete GPU detected or unable to determine GPU type. Skipping GPU driver installation."
69+
fi
5770

5871
# Function to install a package if not already installed
5972
install_package() {
@@ -92,33 +105,27 @@ echo -e "${BLUE} Starting Package Installation... ${NC}"
92105
echo -e "${BLUE}-----------------------------------------------${NC}"
93106

94107
# List of packages to install via pacman
95-
packages_pacman=("neovim" "steam" "goverlay" "lutris" "discord" "timeshift" "xorg-xhost" "htop" "yazi" "thunderbird" "fastfetch" "libreoffice-fresh")
108+
packages_pacman=("neovim" "steam" "goverlay" "lutris" "discord" "timeshift" "xorg-xhost" "htop" "yazi" "thunderbird" "fastfetch" "libreoffice-fresh" "gamemode")
96109

97110
# List of packages to install via AUR
98111
packages_aur=("arch-update" "heroic-games-launcher-bin" "prismlauncher-qt5" "visual-studio-code-bin")
99112

100-
# Check if paru is installed for AUR
101-
echo -e "${YELLOW}Checking if paru is installed...${NC}"
102-
if ! pacman -Q paru &> /dev/null; then
103-
info "Installing paru..."
104-
if sudo pacman -S --noconfirm --needed paru; then
105-
if ! pacman -Q paru &> /dev/null; then
106-
error_exit "Error: paru installation verification failed. Please install paru manually."
107-
fi
108-
success "paru was successfully installed."
109-
else
110-
error_exit "Error installing paru."
111-
fi
112-
fi
113-
success "Paru is installed."
114-
115113
# Ask the user if they want to install Flatpak
116114
echo -e "${YELLOW}Would you like to install Flatpak for additional software support? (y/n)${NC}"
117115
read -r install_flatpak
118116
if [[ "$install_flatpak" == "y" || "$install_flatpak" == "Y" ]]; then
119117
echo -e "${YELLOW}Installing Flatpak...${NC}"
120118
install_package "flatpak"
121119
success "Flatpak was successfully installed."
120+
echo -e "${YELLOW}Would you like to install recommended Flatpak applications (Bottles and EasyFlatpak)? (y/n)${NC}"
121+
read -r install_recommended_flatpaks
122+
if [[ "$install_recommended_flatpaks" == "y" || "$install_recommended_flatpaks" == "Y" ]]; then
123+
flatpak install -y flathub com.usebottles.bottles
124+
flatpak install -y flathub org.dupot.easyflatpak
125+
success "Recommended Flatpak applications installed successfully."
126+
else
127+
echo -e "${YELLOW}Skipping recommended Flatpak applications installation.${NC}"
128+
fi
122129
else
123130
echo -e "${YELLOW}Skipping Flatpak installation.${NC}"
124131
fi

0 commit comments

Comments
 (0)