-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
282 lines (199 loc) · 6.61 KB
/
install.sh
File metadata and controls
282 lines (199 loc) · 6.61 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
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
#!/bin/bash
# -----------------------------------------------------
#
# i3 wm configuration and installation script
# by
# _____ __ ____ _ ___ _
# / ___// /_ ___ / / / / | / (_)___ (_)___ _
# \__ \/ __ \/ _ \/ / / / |/ / / __ \ / / __ `/
# ___/ / / / / __/ / / / /| / / / / / / / /_/ /
# /____/_/ /_/\___/_/_/ /_/ |_/_/_/ /_/_/ /\__,_/
# /___/
#
# -----------------------------------------------------
# --------------- color defination
red="\e[1;31m"
green="\e[1;32m"
yellow="\e[1;33m"
blue="\e[1;34m"
magenta="\e[1;1;35m"
cyan="\e[1;36m"
orange="\e[1;38;5;214m"
end="\e[1;0m"
yes_no="[ ${green}Y${end}/${red}N${end} ]"
# -------------- log directory
dir="$(dirname "$(realpath "$0")")"
source "$dir/functions.sh"
log_dir="$dir/Logs"
log="$log_dir"/i3wm-$(date +%d-%m-%y).log
# mkdir -p "$log_dir"
# touch "$log"
cache="$dir/.cache"
mkdir -p "$cache"
clear && sleep 1
#--------------------------------#
# asking
#--------------------------------#
msg warn "This configuration have no support for any GPU..." && sleep 1
echo
msg ask "Would you like to exit here? $yes_no"
read -p "Select: " scrExit
if [[ "$scrExit" =~ ^[Y|y]$ ]]; then
msg act "Exiting the script here..." && sleep 2
exit 0
else
msg act "Starting the main script here..." && sleep 2 && clear
fi
#--------------------------------#
# startup
#--------------------------------#
display_text && sleep 2
#--------------------------------#
# Checking PKG
#--------------------------------#
check_pkgman && sleep 2 && clear
#--------------------------------#
# starting scritps
#--------------------------------#
scriptsDir="$dir/$pkgman"
# installing aur if it's arch
if [[ "$pkgman" == "pacman" ]]; then
aur=$(command -v yay || command -v paru)
if [ -z $aur ]; then
touch "$dir/Logs/aur.log"
aurlog="$dir/Logs/aur.log"
msg att "Need to install an ${green}aur${end} helper first."
msg ask "Choose one...\n1)paru\n2)yay"
read -p "Select: " aurHlpr
case "$aurHlpr" in
1)
msg act "Installing paru..."
git clone --depth=1 https://aur.archlinux.org/paru.git "$dir/.cache/paru" 2>&1 | tee -a "$aurlog"
cd "$dir/.cache/paru" 2>&1 | tee -a "$aurlog"
makepkg -si --noconfirm 2>&1 | tee -a "$aurlog"
;;
2)
msg act "Installing yay..."
git clone --depth=1 https://aur.archlinux.org/yay.git "$dir/.cache/yay" 2>&1 | tee -a "$aurlog"
cd "$dir/.cache/yay" 2>&1 | tee -a "$aurlog"
makepkg -si --noconfirm 2>&1 | tee -a "$aurlog"
;;
*)
msg err "Invalid option. Please run the script again and select from 1 and 2.."
;;
esac
if [ -n $aur ]; then
msg dn "Aur helper installed successfully!" 2>&1 | tee -a "$aurlog"
else
msg err "Could not install aur helper.." 2>&1 | tee -a "$aurlog"
exit 1
fi
else
echo
msg dn "Aur helper was located, moving on.." 2>&1 | tee -a "$aurlog"
fi
fi
sleep 1 && clear
chmod +x "$scriptsDir"/*
chmod +x "$dir/common"/*
"$scriptsDir/2-pkgs.sh"
"$scriptsDir/3-fonts.sh"
"$scriptsDir/4-cliphist.sh"
msg ask "Would you like to install and use 'SDDM' login manager? $yes_no"
read -p "Select: " login
if [[ "$login" =~ ^[Y|y]$ ]]; then
"$scriptsDir/5-sddm.sh"
fi
"$dir/common/themes.sh"
sleep 1 && clear
#--------------------------------#
# copying dotfiles
#--------------------------------#
configs="$dir/config"
backupDir="$HOME/.config/i3_Backups_${USER}"
if [[ -d "$backupDir" ]]; then
msg att "A Backup directory is already there. Remofing it."
rm -rf "$backupDir"
fi
_dirs=(
dunst
fastfetch
gtk-3.0
gtk-4.0
i3
kitty
Kvantum
menus
nvim
polybar
qt5ct
qt6ct
rofi
dolphinrc
kwalletmanagerrc
kwalletrc
)
mkdir -p "$backupDir"
# backing up dir
for __dir in "${_dirs[@]}"; do
dirPath="$HOME/.config/$__dir"
if [[ -d "$dirPath" || -f "$dirPath" ]]; then
msg act "$__dir directory was found. Backing it up inside $backupDir"
mv "$dirPath" "$backupDir/"
fi
done
piconConf="$HOME/.config/picom.conf"
if [[ -f "$piconConf" ]]; then
msg act "$piconConf directory was found. Backing it up inside $backupDir"
mv "$piconConf" "$backupDir/"
fi
sleep 1 && clear
msg act "Now copying configs..."
cp -r "$configs"/* "$HOME/.config/"
if [[ -d "$HOME/.config/i3/scripts" ]]; then
chmod +x "$HOME/.config/i3/scripts"/*
chmod +x "$HOME/.config/polybar/launch.sh"
fi
# dolphinstaterc
if [[ -f "$HOME/.local/state/dolphinstaterc" ]]; then
mv "$HOME/.local/state/dolphinstaterc" "$HOME/.local/state/dolphinstaterc.back"
fi
# konsole
if [[ -d "$HOME/.local/share/konsole" ]]; then
mv "$HOME/.local/share/konsole" "$HOME/.local/share/konsole.back"
fi
cp "$dir/local/state/dolphinstaterc" "$HOME/.local/state/"
cp -r "$dir/local/share/konsole" "$HOME/.local/share/"
wall="$HOME/.config/i3/Wallpapers/cyberpunk-soldier-sci-fi.jpg"
if [[ -f "$wall" ]]; then
ln -sf "$wall" "$HOME/.config/i3/.cache/current.png"
fi
"$dir/common/monitor.sh"
sleep 1 && clear
#--------------------------------#
# Wallpapers
#--------------------------------#
msg ask "Would you like to add more ${green}Wallpapers${end}? $yes_no"
read -p "Select: " wallpaper
echo
if [[ "$wallpaper" =~ ^[Y|y]$ ]]; then
msg act "Downloading some wallpapers..."
# cloning the wallpapers in a temporary directory
git clone --depth=1 https://github.com/shell-ninja/Wallpapers.git ~/.cache/wallpaper-cache 2>&1 | tee -a "$log" &> /dev/null
# copying the wallpaper to the main directory
if [[ -d "$HOME/.cache/wallpaper-cache" ]]; then
cp -r "$HOME/.cache/wallpaper-cache"/* ~/.config/i3/Wallpapers/ &> /dev/null
rm -rf "$HOME/.cache/wallpaper-cache" &> /dev/null
msg dn "Wallpapers were downloaded successfully..." 2>&1 | tee -a "$log" & sleep 0.5
else
msg err "Sorry, could not download more wallpapers. Going forward with the limited wallpapers..." 2>&1 | tee -a >(sed 's/\x1B\[[0-9;]*[JKmsu]//g' >> "$log") && sleep 0.5
fi
fi
msg dn "Script ends here. Need to reboot your system." && sleep 2 && clear
for time in 5 4 3 2 1; do
msg att "The system will reboot in ${time}s" && sleep 1 && clear
done
systemctl reboot --now
#----------------------------------#
# Script Ends Here
#----------------------------------#