-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.sh
executable file
·313 lines (278 loc) · 8.14 KB
/
installer.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
#!/bin/zsh
###############################################
# EXECUTE THIS SCRIPT FROM THE home DIRECTORY #
###############################################
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RESET='\033[0m'
trap "exit" INT
function check_req {
command -v "$@" >/dev/null 2>&1
}
typeset -a needed_req=(
curl
git
rustup
yarn
zsh
)
typeset -a shell_req=(
bat
dust
kitty
ripgrep
ttf-cascadia-mono-nerd
ttf-nerd-fonts-symbols
zathura
zathura-djvu
zathura-pdf-mupdf
)
typeset -a nvim_req=(
bat
fswatch
luarocks
neovim
npm
python-pynvim
ripgrep
tree-sitter
tree-sitter-cli
)
typeset -a hypr_conf=(
ags-hyprpanel-git
hyprcursor-git
hypridle-git
hyprland
hyprland-protocols
hyprlock-git
hyprpaper-git
hyprshot-git
hyprsunset
hyprutils-git
xdg-desktop-portal-hyprland
sddm-git
texlive-full
)
typeset -a hypr_req=(
baobab
blueman
brightnessctl
gammastep
gnome-power-manager
gnome-system-monitor
gvfs
light
nwg-wrapper
pavucontrol
python
rofi-calc-git
rofi-wayland
sway-audio-idle-inhibit-git
thunar
thunar-archive-plugin
thunar-volman
tlp
tzupdate
waybar
wl-clipboard
wlr-randr
wlogout
xarchiver
)
typeset -a other_packages=(
acestream-engine
acestream-launcher
android-sdk-platform-tools
bibclean
biber
chromium
clang
dbus-python
firefox
fzf
gcc
gdb
gnuplot
imagemagick
libreoffice-fresh
linux-zen
linux-zen-headers
lsd
make
man-db
man-pages
mpv
neofetch
python-pandas
python-matplotlib
python-pyquery
rclone
reflector
spotify
spotify-adblock
sshfs
teams-for-linux
teams-for-linux-wayland-hook
thunderbird
trash-cli
unrar
unzip
vimix-cursors
)
# Git + Github keys
cd
echo -e "${YELLOW}Installing and configuring git...${RESET}"
sudo pacman -S --noconfirm --needed --quiet git
echo -e "${BLUE}Press enter when promted to 'Enter a file in which to save the key', and in 'add passphrase'${RESET}"
ssh-keygen -t ed25519 -C "[email protected]"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
echo -e "${BLUE}Now copy the following key to your Github account in Settings/Access/Ssh keys...${RESET}"
cat ~/.ssh/id_ed25519.pub
echo -e "${BLUE}Press enter to continue once copied the key to Github${RESET}"
read ans
if [ $? -ne 0 ]; then
echo -e "${RED}Error installing and configuring git.${RESET}"
notify-send "Error installing and configuring git" "There was a problem installing and configuring git. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Git installed and configured successfully.${RESET}"
fi
# Git config
git config --global user.name "Victor Ballester Ribo"
git config --global user.email "[email protected]"
# yay (AUR helper)
cd
echo -e "${YELLOW}Installing yay...${RESET}"
sudo pacman -S --noconfirm --needed --quiet base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ..
rm -rf yay
if [ $? -ne 0 ]; then
echo -e "${RED}Error installing yay.${RESET}"
notify-send "Error installing yay" "There was a problem installing yay. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Yay installed successfully.${RESET}"
fi
# needed stuff
if ! check_req yay; then
echo "Make sure you have yay installed!"
return 1
fi
# setup yay and upgrade all packages
yay -Syyuu
# important stuff
yay -S --noconfirm --needed "${needed_req[@]}"
# shell requirements
yay -S --noconfirm --needed "${shell_req[@]}"
rustup default stable # in order to install properly spotify-adblock
# neovim requirements
yay -S --noconfirm --needed "${nvim_req[@]}"
yarn global add neovim
# hyprland requirements
# remove directories aquamarine, otherwise it will fail to install all the packages "hyprSomething-git"
sudo rm -rf /usr/include/aquamarine/ /usr/lib/libaquamarine.so* /usr/lib/pkgconfig/aquamarine.pc /usr/share/licenses/aquamarine/
yay -S --needed "${hypr_conf[@]}"
yay -S --noconfirm --needed "${hypr_req[@]}"
# other packages
yay -S --noconfirm --needed "${other_packages[@]}"
# # install ohmyzsh
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended --keep-zshrc
echo "Installation completed!"
# systemctl enable sddm.service
systemctl enable tlp.service
systemctl start tlp.service
cd
echo -e "${YELLOW}Configuring reflector...${RESET}"
sudo cp dotfiles/others/reflector.conf /etc/xdg/reflector/
sudo systemctl enable reflector.timer # in order to run reflector weekly instead of at each boot
sudo systemctl start reflector.timer
sudo systemctl enable reflector.service
sudo systemctl start reflector.service
if [ $? -ne 0 ]; then
echo -e "${RED}Error configuring reflector.${RESET}"
notify-send "Error configuring reflector" "There was a problem configuring reflector. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Reflector configured successfully.${RESET}"
fi
# copy thunderbird profile
# echo -e "${YELLOW}Copying Thunderbird profile...${RESET}"
# cp -r
# mkdir -p .thunderbird
# sudo cp -r dotfiles/others/*.default-release .thunderbird/
# if [ $? -ne 0 ]; then
# echo -e "${RED}Error copying Thunderbird profile.${RESET}"
# notify-send "Error copying Thunderbird profile" "There was a problem copying Thunderbird profile. Please check the installation process." --urgency=critical
# else
# echo -e "${GREEN}Thunderbird profile copied successfully.${RESET}"
# fi
# configure blueman
echo -e "${YELLOW}Configuring blueman...${RESET}"
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
if [ $? -ne 0 ]; then
echo -e "${RED}Error configuring blueman.${RESET}"
notify-send "Error configuring blueman" "There was
a problem configuring blueman. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Blueman configured successfully.${RESET}"
fi
cd
echo -e "${YELLOW}Installing rclone...${RESET}"
echo -e "${BLUE}Name the remote as 'OneDrive'${RESET}"
rclone config
mkdir -p ~/.config/systemd/user/
mkdir -p ~/OneDrive
sudo cp Desktop/dotfiles/others/rclone-onedrive.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now rclone-onedrive
if [ $? -ne 0 ]; then
echo -e "${RED}Error installing rclone.${RESET}"
notify-send "Error installing rclone" "There was a problem installing rclone. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Rclone installed successfully.${RESET}"
fi
# configure zsh
echo -e "${YELLOW}Configuring zsh...${RESET}"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
sudo cp dotfiles/others/.zshrc ~/
# change to zsh default shell
if [[ ! $SHELL =~ zsh$ ]]; then
echo "Changing default shell"
chsh -s /bin/zsh
fi
if [ $? -ne 0 ]; then
echo -e "${RED}Error configuring zsh.${RESET}"
notify-send "Error configuring zsh" "There was a problem configuring zsh. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Zsh configured successfully.${RESET}"
fi
echo "Copying config files..."
./copyConfig.sh
echo "You may want to reboot your computer!"
echo "Checking installation..."
# Function to check if packages are installed and display status
check_packages() {
local group_name=$1
local packages=$2 # Use nameref to pass the array by reference
echo -e "\nChecking group: ${group_name}"
eval "local package_array=(\"\${${packages}[@]}\")"
for package in "${package_array[@]}"; do
if pacman -Qi $package &> /dev/null; then
echo -e "${GREEN}$package is installed${RESET}"
else
echo -e "${RED}$package is NOT installed${RESET}"
fi
done
}
# Check each group
check_packages "needed_req" needed_req
check_packages "shell_req" shell_req
check_packages "nvim_req" nvim_req
check_packages "hypr_conf" hypr_conf
check_packages "hypr_req" hypr_req
check_packages "other_packages" other_packages