-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinstall.sh
executable file
·382 lines (327 loc) · 10.7 KB
/
install.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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
#!/bin/bash
if [ "$(id -u)" = 0 ]; then
echo ":: This script shouldn't be run as root."
exit 1
fi
clear
GREEN='\033[0;32m'
NONE='\033[0m'
# -----------------------------------------------------
# functions
# -----------------------------------------------------
# check if package is installed
_isInstalledPacman() {
package="$1";
check="$(sudo pacman -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
# install required packages
_installPackagesPacman() {
toInstall=();
for pkg; do
if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All pacman packages are already installed.";
return;
fi;
printf "Package not installed:\n%s\n" "${toInstall[@]}";
sudo pacman --noconfirm -S "${toInstall[@]}";
}
# required packages for the installer
installer_packages=(
"wget"
"unzip"
"gum"
"figlet"
)
# -----------------------------------------------------
# synchronizing package databases
# -----------------------------------------------------
sudo pacman -Sy
echo
# -----------------------------------------------------
# install required packages
# -----------------------------------------------------
echo ":: Checking that required packages are installed..."
_installPackagesPacman "${installer_packages[@]}";
echo
if gum confirm "Have you checked the installation script before running?" ;then
echo
echo ":: Installing Hyprland and additional packages"
echo
elif [ $? -eq 130 ]; then
exit 130
else
echo
echo ":: Installation canceled."
exit;
fi
echo -e "${GREEN}"
cat <<"EOF"
_ _ _ _
| | | |_ _ _ __ _ __| | __ _ _ __ __| |
| |_| | | | | '_ \| '__| |/ _` | '_ \ / _` |
| _ | |_| | |_) | | | | (_| | | | | (_| |
|_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_|
|___/|_|
EOF
echo -e "${NONE}"
echo "Are you using systemd boot or grub?"
boot=$(gum choose systemd grub)
echo "What is the resolution and refresh rate of your monitor?"
echo "Answare in the following format eg. 3440x1440@144"
resolution=$(gum input --placeholder "Resolution and refresh rate...")
echo "Resolution and refresh rate: ${resolution}"
if gum confirm "Are you using Nvidia GPU?" ;then
nvidia=true
echo
echo ":: Nvidia GPU is not officially supported by Hyprland. If you face any problems, please check Hyprland Wiki"
echo ":: https://wiki.hyprland.org/Nvidia/"
echo
if gum confirm "Continue?" ;then
echo
echo ":: Starting the installation"
echo
elif [ $? -eq 130 ]; then
exit 130
else
echo
echo ":: Installation canceled."
exit;
fi
else
nvidia=false
fi
# make yay faster - do not use compression
sudo sed -i "s/PKGEXT=.*/PKGEXT='.pkg.tar'/g" /etc/makepkg.conf
sudo sed -i "s/SRCEXT=.*/SRCEXT='.src.tar'/g" /etc/makepkg.conf
# -----------------------------------------------------
# core packages
# -----------------------------------------------------
echo -e "${GREEN}"
figlet "CorePackages"
echo -e "${NONE}"
# packages
sudo pacman -Sy hyprland waybar rofi-wayland dunst hyprpaper hyprlock hypridle xdg-desktop-portal-hyprland sddm \
alacritty kitty ghostty vim zsh picom qt5-wayland qt6-wayland cliphist \
thunar gvfs thunar-volman tumbler thunar-archive-plugin ark \
network-manager-applet blueman brightnessctl \
slurp grim xclip swappy \
ttf-font-awesome otf-font-awesome ttf-fira-sans ttf-fira-code \
ttf-firacode-nerd gnome-themes-extra gtk-engine-murrine nwg-look \
--noconfirm
yay -S wlogout waypaper hyprland-qtutils qogir-gtk-theme qogir-icon-theme --noconfirm
# oh my zsh
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -) --unattended"
chsh -s $(which zsh)
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/themes/powerlevel10k
# -----------------------------------------------------
# development
# -----------------------------------------------------
if gum confirm "Do you need development setup?" ;then
# git
echo -e "${GREEN}"
figlet "Git"
echo -e "${NONE}"
git_name=$(gum input --placeholder "Enter git name...")
echo "Name: ${git_name}"
git_email=$(gum input --placeholder "Enter git email...")
echo "Email: ${git_email}"
git config --global user.name "${git_name}"
git config --global user.email "${git_email}"
git config --global pull.ff only
ssh-keygen
# java
echo -e "${GREEN}"
figlet "Java"
echo -e "${NONE}"
sudo pacman -Sy jre21-openjdk jdk21-openjdk maven --noconfirm
yay -S google-java-format --noconfirm
# python
echo -e "${GREEN}"
figlet "Python"
echo -e "${NONE}"
sudo pacman -Sy python-pip --noconfirm
# jetbrains
yay -S jetbrains-toolbox --noconfirm
# node
echo -e "${GREEN}"
figlet "Node"
echo -e "${NONE}"
yay -S nvm --noconfirm
source /usr/share/nvm/init-nvm.sh
nvm install --lts
# docker
echo -e "${GREEN}"
figlet "Docker"
echo -e "${NONE}"
sudo pacman -Sy docker --noconfirm
sudo systemctl enable --now docker.service
sudo usermod -aG docker $USER
sudo pacman -Sy docker-compose --noconfirm
# vscode
echo -e "${GREEN}"
figlet "VSCode"
echo -e "${NONE}"
sudo pacman -Sy gnome-keyring --noconfirm
yay -S visual-studio-code-bin --noconfirm
# rest client
yay -S insomnia-bin --noconfirm
# neovim
echo -e "${GREEN}"
figlet "Neovim"
echo -e "${NONE}"
sudo pacman -Sy neovim fzf ripgrep fd --noconfirm
yay -S vim-plug --noconfirm
git clone https://github.com/NvChad/starter ~/.config/nvchad
git clone --depth 1 https://github.com/AstroNvim/template ~/.config/astronvim
git clone https://github.com/LazyVim/starter ~/.config/lazyvim
fi
# -----------------------------------------------------
# apps
# -----------------------------------------------------
# gui apps
echo -e "${GREEN}"
figlet "GUI Apps"
echo -e "${NONE}"
sudo pacman -Sy okular feh gwenview mpv qbittorrent bitwarden qalculate-gtk veracrypt --noconfirm
yay -S onlyoffice-bin brave-bin ventoy-bin webcord --noconfirm
# return default browser to firefox from brave
unset BROWSER
xdg-settings set default-web-browser firefox.desktop
# terminal utils
echo -e "${GREEN}"
figlet "TerminalUtils"
echo -e "${NONE}"
sudo pacman -Sy tmux yazi fastfetch htop --noconfirm
# -----------------------------------------------------
# configs and themes
# -----------------------------------------------------
# dotfiles
echo -e "${GREEN}"
figlet "Dotfiles"
echo -e "${NONE}"
if $nvidia ;then
echo \
"# -----------------------------------------------------
# Environment Variables
# -----------------------------------------------------
# https://wiki.hyprland.org/Nvidia/
env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = NVD_BACKEND,direct
env = ELECTRON_OZONE_PLATFORM_HINT,auto
cursor {
no_hardware_cursors = true
}" > ./config/hypr/conf/environment.conf
echo \
"
# -----------------------------------------------------
# Electron flickering fix
# -----------------------------------------------------
source = ~/.config/hypr/conf/electron-flickering-fix.conf" >> ./config/hypr/hyprland.conf
fi
echo \
"# -----------------------------------------------------
# Monitor Setup
# -----------------------------------------------------
monitor=,${resolution},auto,1" > ./config/hypr/conf/monitor.conf
cp -rf ./config/.gtkrc-2.0 ./config/.Xresources ./config/.bashrc ./config/.zshrc ./config/.p10k.zsh ~/
mkdir -p ~/.config/qBittorrent && cp -rf ./config/qbittorrent/qbittorrent.qbtheme ~/.config/qBittorrent
cp -rf ./config/alacritty ./config/dunst ./config/gtk-3.0 ./config/gtk-4.0 ./config/hypr ./config/picom \
./config/kitty ./config/scripts ./config/Thunar ./config/wal ./config/waybar \
./config/wlogout ./config/fastfetch ./config/ghostty \
~/.config
sudo sed -i "s/Inherits=.*/Inherits=Qogir-dark/g" /usr/share/icons/default/index.theme
# rofi
echo -e "${GREEN}"
figlet "Rofi"
echo -e "${NONE}"
git clone --depth=1 https://github.com/adi1090x/rofi.git ~/rofi
cd ~/rofi
chmod +x setup.sh
sh setup.sh
cd -
rm -rf ~/rofi
# sddm
echo -e "${GREEN}"
figlet "SDDM"
echo -e "${NONE}"
sudo systemctl enable sddm
sudo git clone https://github.com/keyitdev/sddm-astronaut-theme.git /usr/share/sddm/themes/sddm-astronaut-theme
sudo cp /usr/share/sddm/themes/sddm-astronaut-theme/Fonts/* /usr/share/fonts/
echo "[Theme]
Current=sddm-astronaut-theme" | sudo tee /etc/sddm.conf
# wallpapers and screenshots
echo -e "${GREEN}"
figlet "WallpapersScreenshots"
echo -e "${NONE}"
mkdir ~/Pictures/screenshots
cp -r wallpapers/** ~/Pictures
# system configs
echo -e "${GREEN}"
figlet "SystemConfigs"
echo -e "${NONE}"
sudo systemctl enable bluetooth
sudo systemctl enable fstrim.timer
# swapfile
echo -e "${GREEN}"
figlet "Swapfile"
echo -e "${NONE}"
sudo mkswap -U clear --size 8G --file /swapfile
sudo swapon /swapfile
echo "/swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab
# -----------------------------------------------------
# kernel and drivers
# -----------------------------------------------------
# zen kernel
echo -e "${GREEN}"
figlet "ZenKernel"
echo -e "${NONE}"
sudo pacman -Sy linux-zen linux-zen-headers --noconfirm
if [[ "$boot" == "systemd" ]]; then
sudo reinstall-kernels
elif [[ "$boot" == "grub" ]]; then
sudo dracut-rebuild
sudo grub-mkconfig -o /boot/grub/grub.cfg
fi
# nvidia drivers
if $nvidia ;then
echo -e "${GREEN}"
figlet "Nvidia"
echo -e "${NONE}"
sudo pacman -S nvidia-dkms nvidia-utils lib32-nvidia-utils nvidia-settings libva-nvidia-driver --noconfirm
echo "force_drivers+=\" nvidia nvidia_modeset nvidia_uvm nvidia_drm \"" | sudo tee -a /etc/dracut.conf.d/nvidia.conf
echo "options nvidia_drm modeset=1 fbdev=1" | sudo tee -a /etc/modprobe.d/nvidia.conf
if [[ "$boot" == "systemd" ]]; then
sudo reinstall-kernels
elif [[ "$boot" == "grub" ]]; then
sudo dracut-rebuild
sudo grub-mkconfig -o /boot/grub/grub.cfg
fi
fi
# cleanup
echo -e "${GREEN}"
figlet "Cleanup"
echo -e "${NONE}"
sudo pacman -Rns $(pacman -Qtdq) --noconfirm
yay -Sc --noconfirm
echo -e "${GREEN}"
figlet "Done"
echo -e "${NONE}"
echo
echo "DONE! Please reboot your system!"