-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_packages.sh
executable file
·192 lines (165 loc) · 4.44 KB
/
install_packages.sh
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
#!/bin/bash
function check_root() {
# Checking for root access and proceed if it is present
ROOT_UID=0
if [[ "${UID}" -eq "${ROOT_UID}" ]]; then
# Error message
echo 'Do not run me as root.'
echo 'Try ./install_packages.sh'
exit 1
fi
}
check_root
# Define a list of packages to install
pacman_packages=(
"vim"
"neofetch"
"htop"
"curl"
"wget"
"tar"
"git"
"libreoffice-fresh"
"vlc"
"discord"
"thunderbird"
"firefox"
"torbrowser-launcher"
"thunderbird"
"grub-customizer"
"flatpak"
"bitwarden"
"solaar"
"networkmanager-openvpn",
"zip",
"gimp"
"qbittorrent"
"zed"
"prettier"
"gitui"
"adobe-source-han-sans-otc-fonts"
"adobe-source-han-serif-otc-fonts noto-fonts-cjk"
"obsidian"
"rustup"
)
aur_packages=(
"pamac-aur"
"brave-bin"
"visual-studio-code-bin"
"timeshift"
"slack-desktop-wayland"
"spotify"
"notion-app-electron"
"google-chrome"
"teams-for-linux-git"
"valent"
"youtube-music",
"messenger-nativefier"
"nwg-look"
"cursor-bin"
)
flatpak_packages=()
read -p "Do you want to enable bluetooth? default(n) (y/n): " enable_bluetooth
if [[ $enable_bluetooth == "y" || $enable_bluetooth == "Y" ]]; then
pacman_packages+=(
"bluez"
"blueman"
"bluez-utils"
)
fi
# Prompt to install GNOME packages
read -p "Do you want to install GNOME packages? default(n) (y/n) :" install_gnome
if [[ $install_gnome == "y" || $install_gnome == "Y" ]]; then
pacman_packages+=(
"gnome-browser-connector"
"power-profiles-daemon"
)
flatpak_packages+=(
"flathub"
"com.mattjakeman.ExtensionManager"
)
fi
# Prompt to install Wayland packages
read -p "Do you want to install Wayland packages? default(n) (y/n) : " install_wayland
if [[ $install_wayland == "y" || $install_wayland == "Y" ]]; then
pacman_packages+=(
# Fix screen sharing in Wayland for discord
"xwaylandvideobridge"
)
fi
# Prompt to install Wayland packages
read -p "Do you want to install Dev packages? default(n) (y/n): " install_dev
if [[ $install_dev == "y" || $install_dev == "Y" ]]; then
pacman_packages+=(
"docker"
"docker-compose"
"dotnet-sdk"
"aspnet-runtime"
"jdk-openjdk"
)
aur_packages+=(
"aws-cli-v2-bin"
"rider"
"postman-bin"
"datagrip"
"docker-desktop"
"supabase-bin"
)
fi
# Update system package database
echo "Updating system package database..."
sudo pacman -Sy
echo "Installing Pacman packages..."
# Loop through the list of packages and install if not already installed
for package in "${pacman_packages[@]}"; do
if ! pacman -Qi "$package" &> /dev/null; then
echo "Installing package: $package"
sudo pacman -S "$package" --noconfirm
else
echo "Package $package is already installed."
fi
done
# Install Yay
if ! yay --version &> /dev/null; then
echo "yay is not installed, proceeding with installation..."
# Install base-devel and git if they are not already installed
sudo pacman -S --needed base-devel git
# Temporarily change to a temporary directory for yay installation
pushd "$(mktemp -d)" || exit 1
# Clone yay from AUR
git clone https://aur.archlinux.org/yay.git
cd yay || exit 1
# Build and install yay
makepkg -si
# Return to the original directory
popd
fi
echo "Installing AUR packages..."
# Loop through the list and install each package if it is not already installed
for package in "${aur_packages[@]}"; do
# Check if the package is already installed
if yay -Q $package &> /dev/null; then
echo "Package $package is already installed."
else
echo "Installing $package..."
yay -S "$package" --noconfirm
fi
done
for package in "${flatpak_packages[@]}"; do
# Check if the package is already installed
if flatpak list | grep $package &> /dev/null; then
echo "Package $package is already installed."
else
echo "Installing $package..."
flatpak install $package
fi
done
if [[ $enable_bluetooth == "y" ]]; then
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
fi
if [[ $install_gnome == "y" ]]; then
systemctl enable --now power-profiles-daemon.service
sudo systemctl start power-profiles-daemon.service
fi
echo "Installation process complete."