-
Notifications
You must be signed in to change notification settings - Fork 0
/
installs.sh
324 lines (315 loc) · 8.37 KB
/
installs.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
#!/bin/sh
# TODO
# ? Adding apps through appimage
# ? Validate file `desktop-file-validate <PATH to .desktop file>`.
# ? Install (Add to .local/share/applications ) `desktop-file-install --dir=$HOME/.local/share/applications <PATH to .desktop file>`.
# Load constants
. $(pwd)/constants.sh
# Draw ascii art in terminal
draw_ascii() {
case $OS in
"Linux")
printf "\n$GREEN
_ _
| | (_)
| | _ _ __ _ ___ __
| | | | '_ \| | | \ \/ /
| |____| | | | | |_| |> <
|______|_|_| |_|\__,_/_/\_\ \n\n\n$NC"
# Create log file with system info
LogFile="$HOME/.dotfiles/SYSTEM_INFO.log"
if [ ! -f "$LogFile" ]; then
printf "OS Info\n\n$(cat /etc/os-release)\n\n\n" >>$LogFile
printf "CPU Info\n\n$(sudo lscpu)\n\n\n" >>$LogFile
printf "GPU Info\n\n$(sudo lshw -C display)\n\n\n" >>$LogFile
fi
;;
"Darwin")
printf "\n$GREEN
____ _____
/ __ \ / ____|
_ __ ___ __ _ ___ | | | | (___
| _ _ \\ / _ | / __ | | | |\___ \
| | | | | | (_| | (__ | |__| |____) |
|_| |_| |_|\__,_|\___ |\____/|_____/ \n\n\n$NC"
;;
*)
printf "$OS is not supported by this script"
;;
esac
}
app_installs() {
for app in $(echo $1 | sed "s/;/ /g"); do
# Install bitwarden
if [ $app = "Bitwarden" ]; then
install_bitwarden
fi
# Install Authy
if [ $app = "Authy" ]; then
install_authy
fi
# Install Neofetch
if [ $app = "Neofetch" ]; then
install_neofetch
fi
# Install Exa
if [ $app = "Exa" ]; then
install_exa
fi
# Install VScode
if [ $app = "VScode" ]; then
install_code
fi
# Install Flameshot
if [ $app = "Flameshot" ]; then
install_flameshot
fi
# Install CopyQ
if [ $app = "CopyQ" ]; then
install_copyq
fi
if [ $app = "Nardfonts" ]; then
install_nard_fonts
fi
# echo $app
done
}
install_bitwarden() {
case $OS in
"Linux")
case $DIST in
Ububtu | Pop!_OS)
printf "$WHITE$BLUE_HL Installing Bitwarden desktop client$NC\n"
desktop-file-validate $HOME/.dotfiles/linux/appimages/Bitwarden.desktop
desktop-file-install --dir=$HOME/.local/share/applications $HOME/.dotfiles/linux/appimages/Bitwarden.desktop
update-desktop-database $HOME/.local/share/applications
printf "$GREEN Bitwarden desktop client appimage is Installed$NC\n"
;;
esac
;;
"Darwin")
brew install bitwarden
;;
*)
# leave as is
return
;;
esac
}
install_authy() {
case $OS in
"Linux")
case $DIST in
Ububtu | Pop!_OS)
printf "$WHITE$BLUE_HL Installing Authy 2FA TOTP generator$NC\n"
printf "$RED Installing Authy requires to install snap package manager to be installed$NC\n"
sudo apt install snapd
sudo snap install authy
printf "$GREEN authy snap package is installed Installed$NC\n"
;;
*)
printf "Script is not supporting $DIST Linux distribution yet."
;;
esac
;;
"Darwin")
printf "$WHITE$BLUE_HL Installing Authy 2FA TOTP generator$NC\n"
brew install --cask authy
printf "$GREEN authy snap package is installed $NC\n"
;;
*)
# leave as is
return
;;
esac
}
install_exa()
{
case $OS in
"Linux")
case $DIST in
Ububtu | Pop!_OS)
printf "$WHITE$BLUE_HL Installing exa colorized ls replacement$NC\n"
sudo apt install exa
printf "$GREEN exa is installed.$NC\n"
;;
*)
printf "Script is not supporting $DIST Linux distribution yet."
;;
esac
;;
"Darwin")
printf "$WHITE$BLUE_HL Installing exa colorized ls replacement$NC\n"
brew install exa
printf "$GREEN exa is installed.$NC\n"
;;
*)
# leave as is
return
;;
esac
}
install_neofetch()
{
case $OS in
"Linux")
case $DIST in
Ububtu | Pop!_OS)
printf "$WHITE$BLUE_HL Installing Neofetch command line utility$NC\n"
sudo apt install neofetch
printf "$GREEN Neofetch is installed$NC\n"
;;
*)
printf "Script is not supporting $DIST Linux distribution yet."
;;
esac
;;
"Darwin")
printf "$WHITE$BLUE_HL Installing Neofetch command line utility$NC\n"
brew install --cask visual-studio-code
printf "$GREEN Neofetch is installed $NC\n"
;;
*)
# leave as is
return
;;
esac
}
install_code()
{
case $OS in
"Linux")
case $DIST in
Ububtu | Pop!_OS)
printf "$WHITE$BLUE_HL Installing VScode code editor$NC\n"
sudo dpkg --install $HOME/.dotfiles/linux/dpkg/vscode.deb
printf "$GREEN VScode is installed$NC\n"
;;
*)
printf "Script is not supporting $DIST Linux distribution yet."
;;
esac
;;
"Darwin")
printf "$WHITE$BLUE_HL Installing Neofetch command line utility$NC\n"
brew install neofetch
printf "$GREEN Neofetch is installed $NC\n"
;;
*)
# leave as is
return
;;
esac
}
install_flameshot()
{
case $OS in
"Linux")
case $DIST in
Ububtu | Pop!_OS)
printf "$WHITE$BLUE_HL Installing Flameshot screenshot app$NC\n"
sudo apt install flameshot
printf "$GREEN Flameshot is installed$NC\n"
;;
*)
printf "Script is not supporting $DIST Linux distribution yet."
;;
esac
;;
"Darwin")
printf "$WHITE$BLUE_HL Installing Flameshot screenshot app$NC\n"
brew install --cask flameshot
printf "$GREEN Flameshot is installed $NC\n"
;;
*)
# leave as is
return
;;
esac
}
install_copyq()
{
case $OS in
"Linux")
case $DIST in
Ububtu | Pop!_OS)
printf "$WHITE$BLUE_HL Installing copyq clipboard app$NC\n"
sudo apt install copyq
printf "$GREEN copyq is installed$NC\n"
;;
*)
printf "Script is not supporting $DIST Linux distribution yet."
;;
esac
;;
"Darwin")
printf "$WHITE$BLUE_HL Installing copyq clipboard app$NC\n"
brew install --cask copyq
printf "$GREEN copyq is installed $NC\n"
;;
*)
# leave as is
return
;;
esac
}
install_nard_fonts()
{
case $OS in
"Linux")
case $DIST in
Ububtu | Pop!_OS)
printf "$WHITE$BLUE_HL Installing firacode nerdfonts$NC\n"
cp -r -n "$(pwd)/fonts/fira_code_nf" "$HOME/.local/share/fonts"
cp -n "$(pwd)/fonts/PowerlineSymbols.otf" "$HOME/.local/share/fonts"
fc-cache -f -v
printf "$GREEN nerdfonts are installed$NC\n"
;;
*)
printf "Script is not supporting $DIST Linux distribution yet."
;;
esac
;;
"Darwin")
printf "$WHITE$BLUE_HL Installing firacode nerdfonts$NC\n"
cp "$(pwd)/fonts/fira_code_nf/*.ttf" "$HOME/Library/Fonts"
cp "$(pwd)/fonts/PowerlineSymbols.otf" "$HOME/Library/Fonts"
printf "$GREEN nerdfonts are installed $NC\n"
;;
*)
# leave as is
return
;;
esac
}
main() {
# Draw ascii art for specific system
draw_ascii
# Run installs specific to Linux OS
if [ "$OS" = "Linux" ]; then
printf "\n$WHITE$BLUE_HL Script requires to install \"dialog\" command line tool to take user inputs.$NC\n"
# Update and upgrade apt
sudo apt update && sudo apt upgrade
# Install dialog command line tool
sudo apt-get install dialog
# Get user selection for list of app options to install in Linux system
OPTIONS=$(dialog --stdout --title "Select apps to install from the list" --checklist "Use space to select or deselect, and arrow key to navigate" 40 100 40 \
"Bitwarden" "Bitwarden client for password manger https://bitwarden.com/" off \
"Authy" "Authy 2FA TOTP generator https://authy.com/ Requires Snap package manager" off \
"Neofetch" "Neofetch CLI tool for system info https://github.com/dylanaraps/neofetch" off \
"Exa" "exa CLI tool for color code ls command https://the.exa.website/" off \
"VScode" "VScode code editor https://code.visualstudio.com/" off \
"Flameshot" "Screenshot application for linux https://flameshot.org/" off \
"CopyQ" "CopyQ clipboard history utility https://hluk.github.io/CopyQ/" off \
"Nardfonts" "Nard fonts is popular dev env fonts required for p10k omz theme. https://www.nerdfonts.com/font-downloads" off \
>install_options.tmp)
# Clear the screen
clear
OPTIONS=$(cat install_options.tmp | tr -s ' ' ';')
rm -f /tmp/install_options.tmp
# Install selected tools
app_installs "$OPTIONS"
fi
exit 0
}
main