-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall2.sh
More file actions
executable file
·195 lines (179 loc) · 4.28 KB
/
install2.sh
File metadata and controls
executable file
·195 lines (179 loc) · 4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/bin/bash
# Function to check if a command exists
command_exists() {
command -v "$1" &> /dev/null
}
# Function to install a package using pacman, yay, or paru
install_package() {
local package=$1
if echo "$root_password" | sudo -S pacman -S --noconfirm --needed "$package"; then
echo "$package installed with pacman."
elif yay -S --noconfirm --needed "$package"; then
echo "$package installed with yay."
elif paru -S --noconfirm --needed "$package"; then
echo "$package installed with paru."
else
echo "$package could not be installed." >> failed_packages.log
fi
}
# Ensure yay and paru are installed
if ! command_exists yay; then
echo "Installing yay..."
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
cd ..
rm -rf yay
else
echo "yay is already installed."
fi
if ! command_exists paru; then
echo "Installing paru..."
git clone https://aur.archlinux.org/paru-bin.git
cd paru-bin
makepkg -si --noconfirm
cd ..
rm -rf paru
else
echo "paru is already installed."
fi
# List of packages
packages=(
wine
samba
winetricks
obs-studio
discord
libreoffice-fresh
telegram-desktop
fontconfig
yakuake
power-profiles-daemon
firewalld
audacity
krita
obsidian
godot
nano
vim
neovim
python
nodejs
python-pip
npm
git
tgpt-bin
python-seaborn
python-numpy
python-matplotlib
docker
kamoso
haruna
kdenlive
okular
htop
btop
p7zip
unrar
kcalc
gnome-boxes
kdialog
flatpak
vlc
thunderbird-bin
packagekit
packagekit-qt5
packagekit-qt6
google-chrome
snapd
visual-studio-code-bin
p7zip-gui
gwenview
blender
inkscape
nvidia-settings
onedrivegui
tokodon
timeshift
android-tools
python-scikit-learn
python-beautifulsoup4
python-ipykernel
winegui
solaar
noto-fonts-cjk
openrgb
jre
cryfs
encfs
gocryptfs
onlyoffice
ttf-firacode
rust
vesktop
spotify
yazi
ffmpeg
ffmpegthumbs
ffmpegthumbnailer
ffmpegthumbnailer-mp3
dart
fwupd
spectacle
rustdesk-bin
)
# Create a Zenity checklist string
zenity_list=()
zenity_list+=("install_all" "Install All Packages" "FALSE")
for package in "${packages[@]}"; do
zenity_list+=("$package" "$package")
done
# Prompt user to select packages
selected_packages=$(zenity --list --checklist \
--title="Select Packages to Install" \
--text="Select the packages you want to install (or choose Install All Packages):" \
--column="Select" --column="Package" \
"${zenity_list[@]}" \
--width=500 --height=600 \
--separator="|")
if [ $? -ne 0 ]; then
echo "No packages selected. Exiting."
exit 1
fi
# Ask for root password
root_password=$(zenity --password --title="Root Password")
if [ -z "$root_password" ]; then
echo "Root password is required. Exiting."
exit 1
fi
# Update system and install base-devel if not already installed
echo "$root_password" | sudo -S pacman -Syu --needed --noconfirm base-devel
# Check if "Install All Packages" was selected
if [[ "$selected_packages" == *"install_all"* ]]; then
selected_array=("${packages[@]}")
else
# Install selected packages
IFS='|' read -r -a selected_array <<< "$selected_packages"
fi
for package in "${selected_array[@]}"; do
echo "Installing $package..."
install_package "$package"
done
# Enable snapd and classic support if snapd is installed
if command_exists snapd; then
echo "$root_password" | sudo -S systemctl enable --now snapd.socket
echo "$root_password" | sudo -S systemctl enable --now snapd.apparmor.service
echo "$root_password" | sudo -S ln -s /var/lib/snapd/snap /snap
fi
# Enable and start firewalld if installed
if command_exists firewalld; then
echo "$root_password" | sudo -S systemctl enable firewalld
echo "$root_password" | sudo -S systemctl start firewalld
fi
# Echo packages that could not be installed
if [ -f failed_packages.log ]; then
zenity --text-info --filename=failed_packages.log --title="Installation Report" --width=500 --height=300
rm failed_packages.log
else
zenity --info --text="All packages installed successfully."
fi