-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·257 lines (222 loc) · 5.08 KB
/
install.sh
File metadata and controls
executable file
·257 lines (222 loc) · 5.08 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
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
#!/bin/bash
# warning
echo "WARNING: This will overwrite existing config"
read -p "Type 'yes' to continue: " confirm
if [[ "$confirm" != "yes" ]]; then
echo "Aborted."
exit 1
fi
find ~/dotfiles -type f -name "*.sh" -exec chmod +x {} \;
# pacman packages
pacman_packages=(
linux-headers
dkms
git
base-devel
hyprland
hyprlock
hypridle
hyprpaper
sddm
waybar
nwg-dock-hyprland
kitty
nvim
nautilus
xdg-user-dirs
xdg-user-dirs-gtk
ttf-jetbrains-mono-nerd
less
blueman
pavucontrol
gnome-calculator
network-manager-applet
loupe
celluloid
jq
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
polkit-gnome
eza
swaync
hyprshot
nwg-drawer
fastfetch
locate
papirus-icon-theme
ttf-fira-sans
ttf-font-awesome
noto-fonts
noto-fonts-emoji
noto-fonts-cjk
gnome-text-editor
fd
)
echo ">> Updating package database..."
sudo pacman -Syu --noconfirm
echo ">> Installing packages..."
for pkg in "${pacman_packages[@]}"; do
if pacman -Qi "$pkg" &>/dev/null; then
echo "[*] $pkg is already installed"
else
echo "[+] Installing $pkg..."
sudo pacman -S --needed --noconfirm "$pkg"
fi
done
# install yay
if ! command -v yay &>/dev/null; then
echo "[+] yay not found, installing..."
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay
makepkg -si --noconfirm
cd ~
rm -rf /tmp/yay
else
echo "[*] yay is already installed"
fi
# aur packages
aur_packages=(
waypaper
zen-browser-bin
oh-my-posh
nerd-fonts-complete-mono-glyphs
)
yay -Syu --noconfirm
for pkg in "${aur_packages[@]}"; do
if yay -Qi "$pkg" &>/dev/null; then
echo "[*] $pkg is already installed (AUR)"
else
echo "[+] Installing $pkg (AUR)..."
yay -S --noconfirm "$pkg"
fi
done
# install packages used by sun
suns_pacman=(
spotify-launcher
discord
obs-studio
veracrypt
go
rustup
jdk-openjdk
maven
)
suns_aur=(
#rtl8852au-dkms-git
#visual-studio-code-bin
github-desktop-bin
tetrio-desktop
wps-office
ttf-ms-win10-auto
libtiff5
ttf-wps-fonts
google-chrome
dotnet-sdk-bin
beekeeper-studio-bin
)
read -p "Install apps and packages used by sun (may contain bloat)? (y/n): " install_sun
if [[ "$install_sun" == "y" || "$install_sun" == "Y" || "$install_sun" == "yes" || "$install_sun" == "YES" ]]; then
echo ">> Installing pacman packages..."
for pkg in "${suns_pacman[@]}"; do
if pacman -Qi "$pkg" &>/dev/null; then
echo "[*] $pkg is already installed"
else
echo "[+] Installing $pkg..."
sudo pacman -S --needed --noconfirm "$pkg"
fi
done
for pkg in "${suns_aur[@]}"; do
if yay -Qi "$pkg" &>/dev/null; then
echo "[*] $pkg is already installed (AUR)"
else
echo "[+] Installing $pkg (AUR)..."
yay -S --noconfirm "$pkg"
fi
done
fi
# nvidia
read -p "Install NVIDIA drivers? (y/n): " install_nvidia
if [[ "$install_nvidia" == "y" || "$install_nvidia" == "Y" || "$install_nvidia" == "yes" || "$install_nvidia" == "YES" ]]; then
echo "[+] Installing NVIDIA drivers..."
sudo pacman -S --needed --noconfirm nvidia nvidia-utils nvidia-settings
# Create the suspend-hyprland.sh script
sudo tee /usr/local/bin/suspend-hyprland.sh >/dev/null << 'EOF'
#!/bin/bash
case "$1" in
suspend)
killall -STOP Hyprland
;;
resume)
killall -CONT Hyprland
;;
esac
EOF
# Make the script executable
chmod +x /usr/local/bin/suspend-hyprland.sh
# Create the hyprland-suspend.service systemd service file
sudo tee /etc/systemd/system/hyprland-suspend.service >/dev/null << 'EOF'
[Unit]
Description=Suspend hyprland
Before=systemd-suspend.service
Before=systemd-hibernate.service
Before=nvidia-suspend.service
Before=nvidia-hibernate.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/suspend-hyprland.sh suspend
[Install]
WantedBy=systemd-suspend.service
WantedBy=systemd-hibernate.service
EOF
# Create the hyprland-resume.service systemd service file
sudo tee /etc/systemd/system/hyprland-resume.service >/dev/null << 'EOF'
[Unit]
Description=Resume hyprland
After=systemd-suspend.service
After=systemd-hibernate.service
After=nvidia-resume.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/suspend-hyprland.sh resume
[Install]
WantedBy=systemd-suspend.service
WantedBy=systemd-hibernate.service
EOF
# Reload the systemd daemon and enable the newly created services
systemctl daemon-reload
systemctl enable hyprland-suspend
systemctl enable hyprland-resume
sudo tee /etc/modprobe.d/blacklist-nouveau.conf >/dev/null << 'EOF'
blacklist nouveau
options nouveau modeset=0
EOF
sudo mkinitcpio -P
else
echo "[*] Skipping NVIDIA driver installation."
fi
# install dotfiles
mkdir ~/.config
cp -a ~/dotfiles/home/. ~/
cp -a ~/dotfiles/dotconfig/. ~/.config/
cd
rm -rf dotfiles/
# sddm
sudo systemctl enable sddm
# folders
xdg-user-dirs-update
# clear cache
echo "[-] Clearing cache"
yay -Sc --noconfirm
echo "[!] Done"
# restart
read -p "Do you want to restart now? [y/N]: " restart
case "$restart" in
[yY][eE][sS]|[yY])
echo "Rebooting..."
reboot
;;
*)
echo "Skipped restart."
;;
esac