-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBMpostInstall-v2.1.sh
executable file
·299 lines (250 loc) · 11.6 KB
/
BMpostInstall-v2.1.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
#!/bin/bash
#CORES
VERMELHO='\e[1;91m'
VERDE='\e[1;92m'
CORR='\e[1;96m'
SEM_COR='\e[0m'
#USER CREDENTIALS
$USER_NAME=$(whoami)
PROGRAMAS_DEB=(
snapd
git
curl
build-essential
gcc
make
dkms
libssl-dev
python3
zsh
gdebi
apt-transport-https
ca-certificates
flatpak
gnome-software-plugin-flatpak
gnome-sushi
folder-color
software-properties-common
docker-ce
gh
neovim
gnome-sushi
folder-color
)
SNAP_APPS=(
spotify
insomnia
wps-office-multilang
mysql-workbench-community
)
FLATPAK_APPS=(
com.discordapp.Discord
org.videolan.VLC
org.telegram.desktop
org.qbittorrent.qBittorrent
org.flameshot.Flameshot
com.uploadedlobster.peek
io.github.webcamoid.Webcamoid
com.github.alainm23.planner
com.microsoft.Teams
org.gimp.GIMP
com.microsoft.Edge
com.google.Chrome
flathub com.slack.Slack
com.getpostman.Postman
net.codeindustry.MasterPDFEditor
us.zoom.Zoom
)
# -------------------------------TESTES E REQUISITOS----------------------------------------- #
# Internet conectando?
if ! ping -c 1 8.8.8.8 -q &> /dev/null; then
echo -e ${VERMELHO}
echo "|:============================[ERROR]=====================================:|"
echo "|: :|"
echo "|: Seu computador não tem conexão com a Internet. Verifique a rede. :|"
echo "|: :|"
echo "|:============================[ERROR]=====================================:|"
echo -e ${SEM_COR}
exit 1
else
echo -e ${CIANO}
echo "|:<=================================================================>:|"
echo "|:| Iniciando script |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
fi
echo -e ${ROXO}
echo "|:<=================================================================>:|"
echo "|:| Configurando credencias |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
echo -e ${WHITE}
echo "|:<===========================================================================>:|"
echo -"Para configurar o git informe o usuario e e-mail do GitHub conforme solicitados"
echo " "
echo "Digite o seu e-mail do GitHub:"
read GIT_EMAIL
echo " "
echo "Digite o seu usuario do GitHub:"
read GIT_USER
echo -e "${LARANJA}|:<=================================================================>:|${SEM_COR}"
echo -e "Para continuar digite Senha ${VERMELHO}'!DO COMPUDADOR!':${SEM_COR}"
read USER_PSW
echo -e ${WHITE}
echo "|:<=================================================================>:|"
echo "|:| Removendo travas eventuais do apt |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
sudo rm /var/lib/dpkg/lock-frontend ; sudo rm /var/cache/apt/archives/lock ;
echo -e ${AZUL}
echo "|:<=================================================================>:|"
echo "|:| Confirmando arquitetura de 32 bits |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
sudo dpkg --add-architecture i386
echo -e ${LARANJA}
echo "|:<=================================================================>:|"
echo "|:| Removendo possivels versções antigas do nodeJS e docker |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
sudo apt purge -y nodejs npm;
sudo apt purge -y nodejs*;
sudo apt purge -y docker;
echo -e ${CIANO}
echo "|:<=================================================================>:|"
echo "|:| Add Repositorio do NodeJS - Docker - FlatHub |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt dist-upgrade -y &&
echo -e ${CIANO}
echo "|:<=================================================================>:|"
echo "|:| Instalando pacotes e programas do repositório deb do Ubuntu |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
for nome_do_programa in ${PROGRAMAS_DEB[@]}; do
if ! dpkg -l | grep -q $nome_do_programa; then
echo -e ${LARANJA}
echo "|:<=================================================================>:|"
echo " Instalando $nome_do_programa "
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
sudo apt install "$nome_do_programa" -y
else
echo -e ${WHITE}
echo "|:<=================================================================>:|"
echo " $nome_do_programa já esta instalado. "
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
fi
done
echo -e ${CIANO}
echo "|:<=================================================================>:|"
echo "|:>== Instalando pacotes snap e flatpak >==:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo &&
for nome_do_programa in ${SNAP_APPS[@]}; do
if ! snap list | grep -q $nome_do_programa; then
echo -e ${AZUL}
echo "|:<=================================================================>:|"
echo " Instalando $nome_do_programa "
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
sudo snap install "$nome_do_programa"
else
echo -e ${WHITE}
echo "|:<=================================================================>:|"
echo " $nome_do_programa já esta instalado. "
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
fi
done
## Instalando Snap Apps que utilizam confinamento classico
sudo snap install code --classic
sudo snap install node --classic
#classic confinament
for nome_do_programa in ${FLATPAK_APPS[@]}; do
if ! flatpak list | grep -q $nome_do_programa; then
echo -e ${AZUL}
echo "|:<=================================================================>:|"
echo " Instalando $nome_do_programa "
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
sudo flatpak install flathub "$nome_do_programa" -y
else
echo -e ${WHITE}
echo "|:<=================================================================>:|"
echo " $nome_do_programa já esta instalado. "
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
fi
done
echo -e ${WHITE}
echo "|:<=================================================================>:|"
echo "|:| Criando pastas de trabalho |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
mkdir /home/$USER/WORKSPACE
mkdir /home/$USER/WORKSPACE/DEVELOPMENT
mkdir /home/$USER/WORKSPACE/PERSONAL
mkdir /home/$USER/WORKSPACE/TRYBE
mkdir /home/$USER/WORKSPACE/TRYBE/PROJECTS
mkdir /home/$USER/WORKSPACE/TRYBE/EXERCICES
mkdir /home/$USER/WORKSPACE/TRYBE/MSC
mkdir /home/$USER/AppImage
echo -e ${ROXO}
echo -e ${LARANJA}
echo "|:<=================================================================>:|"
echo "|:| --- Baixando fontes com simbolus e ligatures --- |:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
wget -c https://github.com/blmarquess/postInstall/blob/main/fonts.zip?raw=true
mv fonts.zip?raw=true fonts.zip
unzip fonts.zip
mv fonts /home/$USER/.local/share/
rm -rf fonts.zip
fc-cache -f -v
curl -L https://github.com/Diolinux/PhotoGIMP/releases/download/1.0/PhotoGIMP.by.Diolinux.v2020.for.Flatpak.zip -o ~/Downloads/PhotoGIMP.by.Diolinux.v2020.for.Flatpak.zip && unzip ~/Downloads/PhotoGIMP.by.Diolinux.v2020.for.Flatpak.zip -d ~/Downloads && cp -R ~/Downloads/PhotoGIMP\ by\ Diolinux\ v2020\ for\ Flatpak/.var/app/org.gimp.GIMP/config/GIMP/2.10/ ~/Library/Application\ Support/GIMP/2.10 && rm ~/Downloads/PhotoGIMP.by.Diolinux.v2020.for.Flatpak.zip
echo -e ${ROXO}
echo "|:<=================================================================>:|"
echo "|:| ---- Configurando Git e Criando chave ssh em ./ssh ---- :|"
echo "|:<=================================================================>:|"
git config --global user.name "$USER"
git config --global user.email "$GIT_EMAIL"
git config --global core.editor "code --wait"
if [ ! -f ~/.ssh/id_ed25519.pub ];then
ssh-keygen -q -t ed25519 -N "$USER_PSW" -C $GIT_EMAIL -f ~/.ssh/id_ed25519 > /dev/null
ssh-add ~/.ssh/id_ed25519
fi
echo -e ${SEM_COR}
echo "|:<=================================================================>:|"
echo "|:>== Finalizado >==:|"
echo "|:<=================================================================>:|"
echo -e ${SEM_COR}
echo "|:<=================================================================>:|"
echo "|:| ---- Definindo zsh como shell padrão ---- |:|"
echo "|:<=================================================================>:|"
chsh -s $(which zsh)
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position 'BOTTOM'
gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed true
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 28
gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-background-shadow-radius 6
gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-background-shadow-enabled false
gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-enabled true
echo -e ${SEM_COR}
echo "|:<=================================================================>:|"
echo "|:>== Configurando o zsh/ohMyZsh >==:|"
echo "|:<=================================================================>:|"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo -e ${AZUL}
echo -e "${AZUL}|:<=================================================================>:|${SEM_COR}"
echo -e "${WHITE}|:| Reinicieo o sistema ..! |:|${SEM_COR}"
echo -e "${AZUL}|:<=================================================================>:|${SEM_COR}"