-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfedorafresh.sh
executable file
·173 lines (151 loc) · 6.79 KB
/
fedorafresh.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
#!/bin/bash
# Creado por: rcv11x (Alejandro M) (2024)
# Licencia: MIT
source "scripts/utils.sh"
source "scripts/install_dnf_packages.sh"
source "scripts/install_flatpak_packages.sh"
source "scripts/packages_list.sh"
trap stop_script INT
function show_banner() {
echo -e " _____ _ _____ _ "
echo -e " | ___|__ __| | ___ _ __ __ _| ___| __ ___ ___| |__ "
echo -e " | |_ / _ \/ _' |/ _ \| '__/ _' | |_ | '__/ _ \/ __| '_ \ "
echo -e " | _| __/ (_| | (_) | | | (_| | _|| | | __/\__ \ | | | "
echo -e " |_| \___|\__,_|\___/|_| \__,_|_| |_| \___||___/_| |_| \n"
echo -e "Hola! $(whoami) | Fedora: ${fedora_variant} v${fedora_version} \n\n"
}
function menu() {
echo -e "(1) ${cyan}Instalar FedoraFresh${default}"
echo -e "(2) ${cyan}Instalar/Desintalar paquetes Fedora${default}"
echo -e "(3) ${cyan}Instalar/Desinstalar paquetes Flatpak${default}"
echo -e "(4) ${cyan}Aplicar temas GRUB${default}"
echo -e "(5) ${cyan}Limpiar y Optimizar distro${default}"
echo -e "(6) ${cyan}Instalar drivers para mandos Xbox${default}"
echo -e "(i) ${cyan}Informacion del sistema${default}"
echo -e "(0) ${cyan}Exit${default}\n"
}
function installation() {
clear
check_deps
custom_banner_text "${yellow} A continuacion se va a ejecutar el script de instalacion ¿Seguro que quieres continuar? [yY/nN]${default}";
read -r -p "${prompt}" yesno
if [[ $yesno == "n" || $yesno == "N" ]]; then
clear
main
elif [[ $yesno == "y" || $yesno == "Y" ]]; then
clear
custom_banner_text "${yellow} EMPEZANDO INSTALACION ${default}\n"; sleep 2; clear
sudo mkdir -pv /usr/local/share/fonts/custom/
mkdir -pv "$HOME/Imágenes/wallpapers/"
mkdir -pv "$HOME/.icons"
mkdir -pv "$HOME/.config/kitty"
mkdir -pv "$current_dir/fonts/"
dnf_hacks
check_rpm_fusion
install_multimedia
install_flatpak
# echo -e "\n${purple}[!] Instalando paquetes...${default}\n"
# sudo dnf install -y "${dnf_packages[@]}"; sleep 1.5
# echo -e "$(msg_ok) Listo.\n"
echo -e "\n${purple}[!] Instalando VS Code...${default}\n"
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
dnf check-update
sudo dnf -y install code
# sudo dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge && sudo dnf update --refresh
# sudo dnf install -y microsoft-edge-stable
echo -e "$(msg_ok) Listo.\n"
# -- CONFIGURACION -- #
echo -e "\n${purple}[!] Instalando plugins de ZSH para $USER y root...${default}\n"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended; sleep 2
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sudo git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /root/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
sudo git clone https://github.com/zsh-users/zsh-autosuggestions /root/.oh-my-zsh/custom/plugins/zsh-autosuggestions
sudo chsh -s "$(which zsh)" "$USER"
sudo chsh -s "$(which zsh)" root
rm -rf "$HOME/.zshrc"
cp -rv config/.zshrc "$HOME"
sudo rm -rf /root/.zshrc
sudo ln -sfv ~/.zshrc /root/.zshrc
echo -e "\n${purple}[!] Configurando Kitty y Nano...${default}\n"
cp -rv config/kitty/* "$HOME/.config/kitty"
cp -rv config/.nano "$HOME"
cp -rv config/.nanorc "$HOME"
sleep 2
install_fonts
echo -e "\n${purple}[!] Aplicando temas de mouse, wallpaper y otras configuraciones...${default}\n"
cp -rv config/.icons/* "$HOME/.icons/"
cp -rv wallpapers/ "$HOME/Imágenes/"
kwriteconfig6 --file "$HOME"/.config/kcminputrc --group Mouse --key cursorTheme "Bibata-Modern-Ice"
plasma-apply-wallpaperimage "/home/$USER/Imágenes/wallpapers/4k/250345-final.png"
{
echo
echo "[services][kitty.desktop]"
echo "_launch=Meta+Return"
} >> "$HOME/.config/kglobalshortcutsrc"
echo -e "\n${purple}[!] Estableciendo un nombre de HOST para la maquina ¿Que nombre le quieres poner? Ej. (mipc, pc-juan...)${default}\n"
read -r -p "Hostname: " opcion
sudo hostnamectl set-hostname "$opcion"
install_gpu_drivers
update_firmware
if kdialog --title "Instalacion terminada" --yesno "Instalacion exitosa!\n\n Ahora espera de 5 a 10 minutos (en el caso de que tengas una gpu nvidia) ya que se estarán compilando los modulos del kernel, de lo contrario puedes reiniciar\n - El PC se reiniciará automaticamente en 5 minutos" \
--yes-label "Reiniciar ahora" --no-label "Cancelar" 2> /dev/null; then
sudo reboot now
else
sudo shutdown -r +5
fi
fi
}
function main(){
clear
if [[ $(id -u) = 0 || $(whoami) = "root" ]]; then
echo -e "\n${red}[!] Ejecuta el script sin permisos de sudo\n${default}"
exit 1
else
while true; do
show_banner
menu
read -r -p "${prompt}" opcion
case $opcion in
1)
installation
;;
2)
clear
install_packages
;;
3)
clear
install_flatpak_packages
;;
4)
clear
apply_grub_themes
;;
5)
clear
optimization
;;
6)
clear
install_xbox_controllers
;;
i)
clear
view_system_info
;;
0)
exit 0
;;
*)
echo -e "\n${red}[!] Opción no válida${default}"
press_any_key
clear
;;
esac
done
fi
}
main