-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup-fedora.sh
executable file
·464 lines (380 loc) · 10.3 KB
/
setup-fedora.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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
#!/bin/bash
# Script created for personal use.
# author: Tiago Lucas Flach
# https://github.com/tiagoFlach
# Scripts - https://plus.diolinux.com.br/t/compartilhe-seus-scripts-de-pos-instalacao/7452
# ------------------------------- CONFIGURAÇÕES ------------------------------ #
# Define colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
BOLDBLUE='\033[1;34m'
NC='\033[0m' # No Color
# Informações do sistema
system="$(lsb_release -sd)"
machine="$(uname -m)"
arch="amd64"
arch2="x64"
arch3="64"
if [ "$machine" != "x86_64" ]; then
arch="i386"
arch2="ia32"
arch3="32"
fi
## ---------- Tela Inicial ---------- ##
COLS="$(tput cols)"
SPACES1=" "
SPACES2=" "
SPACES3=" "
LINE1=""
LINE2=""
LINE3=""
LINE4=""
LINE5=""
LINE6=""
LINE7=""
LINE8=""
# ----------
for ((i = 0; i < $COLS; i++)); do
LINE1+="-"
done
echo -e "${BLUE}"$LINE1
echo $LINE1
# ----------
# 29
# 31
for ((i = 0; i < ((($COLS - 31) / 2) - 8); i++)); do
LINE2+="-"
done
LINE2+=" ${NC}LINUX PERSONAL - FEDORA 36${BLUE} "
for ((i = 0; i < ((($COLS - 31) / 2) - 8); i++)); do
LINE2+="-"
done
echo -e "${SPACES1}"$LINE2
# ----------
echo $LINE1
# ----------
# 25
# 27
for ((i = 0; i < ((($COLS - 27) / 2) - 16); i++)); do
LINE3+="-"
done
LINE3+=" ${NC}Author: Tiago Lucas Flach${BLUE} "
for ((i = 0; i < ((($COLS - 27) / 2) - 16); i++)); do
LINE3+="-"
done
echo -e "${SPACES2}"$LINE3
# ----------
for ((i = 0; i < ($COLS - 48); i++)); do
LINE4+="-"
done
echo -e "${SPACES3}"$LINE4"${NC}\n"
# ----------
echo -e "${BOLDBLUE}System: ${NC}$system"
echo -e "${BOLDBLUE}Architecture: ${NC}$arch"
echo -e "${BOLDBLUE}Home: ${NC}$HOME"
echo -e "${BOLDBLUE}User: ${NC}$USER\n\n"
# ---------------------------------------------------------------------------- #
# --------------------------------- VARIÁVEIS -------------------------------- #
OS_RELEASE_ID=$(grep "^ID=" /etc/os-release | cut -d '=' -f 2- | sed 's|"||g')
OS_RELEASE_VERSION_ID=$(grep "^VERSION_ID=" /etc/os-release | cut -d '=' -f 2- | sed 's|"||g')
# ----- COPRs -----#
COPRS=(
zeno/scrcpy # Scrcpy
)
# AnyDesk
cat >/etc/yum.repos.d/AnyDesk-Fedora.repo <<"EOF"
[anydesk]
name=AnyDesk Fedora - stable
baseurl=http://rpm.anydesk.com/fedora/$basearch/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://keys.anydesk.com/repos/RPM-GPG-KEY
EOF
# Skype
URL_SKYPE_REPO="https://repo.skype.com/rpm/stable/skype-stable.repo"
# ----- URLs -----#
# Google Earth Pro
URL_GOOGLE_EARTH_PRO="https://dl.google.com/dl/earth/client/current/google-earth-stable_current_x86_64.rpm"
# Microsoft Teams
URL_MS_TEAMS="https://teams.microsoft.com/downloads/desktopurl?env=production&plat=linux&arch=x64&download=true&linuxArchiveType=deb"
## ----- Diretório de Downloads ----- ##
DIRETORIO_DOWNLOADS="$HOME/Downloads/programas"
## ----- Pré-requisitos ----- ##
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
## ----- Programas a serem instalados via dnf ----- ##
PROGRAMS_DNF=(
# Sistema
akmod-nvidia
android-tools
dnf-plugins-core
ffmpeg
ffms2-devel
lsb
redhat-lsb-core
meson
net-tools
nautilus-image-converter
rar
rpmfusion-free-obsolete-packages
SDL2-devel
ufw
unrar
unzip
wmctrl
zip
# CLI
cmatrix
git
btop
htop
neofetch
speedtest
yt-dlp
# Fontes
adobe-source-sans-pro-fonts
baekmuk-*
cascadia-code-fonts
dejavu-fonts-*
texlive-lstfiracode
fontawesome*
fira-code-fonts
fonts-hack
fonts-hack-ttf
fonts-havana
fonts-junicode
fonts-lato
fonts-league-spartan
fonts-lemonada
fonts-le-murmure
fonts-lexi-gulim
fonts-lindenhill
fonts-lmodern
fonts-lyx
fonts-millimetre
fonts-mplus
fonts-nanum
fonts-noto-color-emoji
open-sans-fonts
fonts-osifont
fonts-oxygen
fonts-paratype
fonts-prociono
fonts-roboto
fonts-roboto-slab
fonts-tomsontalks
fonts-ubuntu-console
fonts-vollkorn
fonts-yanone-kaffeesatz
ttf-ancient-fonts
ttf-mscorefonts-installer
# Gnome
chrome-gnome-shell
dconf-editor
gnome-backgrounds
gnome-clocks
gnome-epub-thumbnailer
gnome-extensions-app
gnome-firmware
gnome-tweaks
gnome-weather
gparted
# Gstreamer
gstreamer1-plugins-bad-\*
gstreamer1-plugins-good-\*
gstreamer1-plugins-base
gstreamer1-plugin-openh264
gstreamer1-libav
# Lame
lame\*
# Aplicativos
anydesk
discord
inkscape
google-chrome-stable
obs-studio
# remmina
scrcpy
stacer
stellarium
# synaptic
timeshift
# virtualbox
# virtualbox-dkms
vlc
)
## ----- Prgramas a serem instalados via Flatpak ----- ##
PROGRAMS_FLATPAK=(
com.belmoussaoui.Decoder
com.discordapp.Discord
com.github.finefindus.eyedropper
com.github.k4zmu2a.spacecadetpinball
io.gitlab.news_flash.NewsFlash
com.mattjakeman.ExtensionManager
com.obsproject.Studio
com.simplenote.Simplenote
com.skype.Client
com.slack.Slack
com.spotify.Client
de.haeckerfelix.Shortwave
io.github.seadve.Mousai
org.gabmus.whatip
org.gimp.GIMP
org.gnome.Boxes
org.gnome.Loupe
org.gnome.Maps
org.gnome.gitlab.somas.Apostrophe
org.gnome.gitlab.somas.Apostrophe.Plugin.TexLive
org.gnome.SoundRecorder
# org.kde.kdenlive
org.musescore.MuseScore
org.remmina.Remmina
org.telegram.desktop
)
# ---------------------------------------------------------------------------- #
# -------------------------------- PRE-INSTALL ------------------------------- #
# Removendo programas desnecessários
# Yelp
sudo dnf remove yelp -y
# ---------------------------------------------------------------------------- #
# -------------------------------- REQUISITOS -------------------------------- #
# Configure DNF for Faster Downloads of Packages
sudo sed -i -e '$a# Added for speed:\nfastestmirror=True\ndeltarpm=True\ndefaultyes=True\nmax_parellel_downloads=10' /etc/dnf/dnf.conf
## ----- Atualizando o repositório ----- ##
# RPM Fusion Free/Non-Free
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -y
sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y
# AppStream metadata
sudo dnf groupupdate core
# Multimedia post-install
sudo dnf groupupdate multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin
sudo dnf groupupdate sound-and-video
## ----- Adicionando repositórios de terceiros ----- ##
for copr in ${COPRS[@]}; do
sudo dnf copr enable "$copr" -y
done
# Skype
# sudo dnf config-manager --add-repo $URL_SKTYPE_REPO
# Speedtest
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
# ---------------------------------------------------------------------------- #
# --------------------------------- EXECUÇÃO --------------------------------- #
# Atualizando o repositório depois da adição de novos repositórios
sudo dnf update -y
## ----- Download e instalaçao de programas externos ----- ##
mkdir "$DIRETORIO_DOWNLOADS"
wget -c "$URL_GOOGLE_EARTH_PRO" -P "$DIRETORIO_DOWNLOADS"
wget -c "$URL_MS_TEAMS" -P "$DIRETORIO_DOWNLOADS"
# Instalando pacotes .deb baixados na sessão anterior
sudo dnf install $DIRETORIO_DOWNLOADS/*.rpm
# ----- Instalar programas no dnf ----- ##
for nome_do_programa in ${PROGRAMS_DNF[@]}; do
if ! rpm -qa | grep -q $nome_do_programa; then # Só instala se já não estiver instalado
echo -e "\n\n${YELLOW}"$LINE1
echo -e " [INSTALANDO] - $nome_do_programa ${NC}"
echo -e "${YELLOW}"$LINE1"${NC}\n"
sudo dnf -y -q install "$nome_do_programa"
fi
done
## ----- Instalando pacotes Flatpak ---- -##
sudo flatpak update -y
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
for program_name in ${PROGRAMS_FLATPAK[@]}; do
if ! flatpak list | grep -q $program_name; then # Só instala se já não estiver instalado
echo -e "\n\n${YELLOW}"$LINE1
echo -e " [INSTALANDO] - $program_name ${NC}"
echo -e "${YELLOW}"$LINE1"${NC}\n"
flatpak install flathub "$program_name" -y
fi
done
# ---------------------------------------------------------------------------- #
# ------------------------------- POST INSTALL ------------------------------- #
# Remove packages
sudo dnf remove gstreamer1-plugins-bad-free-devel -y
sudo dnf remove lame-devel -y
# Multimídia
sudo dnf group upgrade --with-optional Multimedia -y
# Change Hostname
sudo hostnamectl set-hostname "Falcon-G5"
# UFW
sudo ufw enable
## ----- Finalização, atualização e limpeza ----- ##
sudo dnf update -y
sudo flatpak update -y
sudo flatpak repair
sudo dnf autoremove -y
sudo dnf clean all -y
# ---------------------------------------------------------------------------- #
# -------------------------------- CHECKLIST --------------------------------- #
echo -e "\nDNF's instalados:"
for program_name in ${PROGRAMS_DNF[@]}; do
# Verifica se o programa esta istalado
if rpm -qa | grep -q $program_name; then
echo -e " ${GREEN}[INSTALADO] - $program_name ${NC}"
else
echo -e " ${RED}[FALHOU] - $program_name ${NC}"
fi
done
echo -e "\nFLATPAK's instalados:"
for program_name in ${PROGRAMS_FLATPAK[@]}; do
# Verifica se o programa esta istalado
if flatpak list | grep -q $program_name; then
echo -e " ${GREEN}[INSTALADO] - $program_name ${NC}"
else
echo -e " ${RED}[FALHOU] - $program_name ${NC}"
fi
done
# ---------------------------------------------------------------------------- #
# ---------------------------------- FOOTER ---------------------------------- #
echo -e "\n\n"
echo -e "${SPACES3}${BLUE}"$LINE4
# ----------
# 7
# 9
for ((i = 0; i < ((($COLS - 9) / 2) - 16); i++)); do
LINE5+="-"
done
LINE5+=" ${NC}THE END${BLUE} "
for ((i = 0; i < ((($COLS - 9) / 2) - 16); i++)); do
LINE5+="-"
done
echo -e "${SPACES2}"$LINE5
# ----------
# 39
# 41
for ((i = 0; i < ((($COLS - 41) / 2) - 8); i++)); do
LINE6+="-"
done
LINE6+=" ${NC}It is recommended to restart the system${BLUE} "
for ((i = 0; i < ((($COLS - 41) / 2) - 8); i++)); do
LINE6+="-"
done
echo -e "${SPACES1}"$LINE6
# ----------
echo -e "${BLUE}"$LINE1
# ----------
# 25
# 27
for ((i = 0; i < ((($COLS - 27) / 2) - 8); i++)); do
LINE7+="-"
done
LINE7+=" Author: Tiago Lucas Flach "
for ((i = 0; i < ((($COLS - 27) / 2) - 8); i++)); do
LINE7+="-"
done
echo -e "${SPACES1}"$LINE7
# ----------
# 11
# 13
for ((i = 0; i < ((($COLS - 13) / 2) - 16); i++)); do
LINE8+="-"
done
LINE8+=" @flachtiago "
for ((i = 0; i < ((($COLS - 13) / 2) - 16); i++)); do
LINE8+="-"
done
echo -e "${SPACES2}"$LINE8
# ----------
echo -e "${BLUE}"$LINE1
# ----------------------------------- END ------------------------------------ #