Compare commits

..

22 commits

Author SHA1 Message Date
Maxi Zamorano
9476a7470a
Merge pull request #8 from MaxiZamorano/release-dev
Release 2.1
2023-05-08 23:26:42 -04:00
Maxi Zamorano
533e9837fb
Update README.md 2023-05-08 23:25:24 -04:00
Maxi Zamorano
ab76e33c59
Update light-en.sh 2023-05-08 23:22:13 -04:00
Maxi Zamorano
42988fe4ca
Merge pull request #7 from MaxiZamorano/release-dev
Release 2.1
2023-05-08 23:19:59 -04:00
Maxi Zamorano
990fea7621
Update README.md 2023-05-08 23:16:21 -04:00
Maxi Zamorano
6c182ecc3a
Update README.md 2023-05-08 22:42:40 -04:00
Maxi Zamorano
e5e7f79252
Rename install-light-es.sh to install/light-es.sh 2023-05-08 22:25:34 -04:00
Maxi Zamorano
0e657241af
Rename install-light-en.sh to install/light-en.sh 2023-05-08 22:25:23 -04:00
Maxi Zamorano
4bac6a659b
Rename install-dark-es.sh to install/dark-es.sh 2023-05-08 22:25:10 -04:00
Maxi Zamorano
c152980287
Rename install-dark-en.sh to install/dark-en.sh 2023-05-08 22:24:27 -04:00
Maxi Zamorano
e3faac765d
Create install-light-en.sh 2023-05-08 22:20:33 -04:00
Maxi Zamorano
61cd3a6cbb
Create install-dark-en.sh 2023-05-08 22:14:05 -04:00
Maxi Zamorano
6b7ba7d500
Update install-light-es.sh 2023-05-08 22:12:30 -04:00
Maxi Zamorano
31505705e2
Update install-dark-es.sh 2023-05-08 22:12:20 -04:00
Maxi Zamorano
4a1ddbcabb
Update install-light-es.sh 2023-05-08 22:11:48 -04:00
Maxi Zamorano
b351952701
Update install-dark-es.sh 2023-05-08 22:11:26 -04:00
Maxi Zamorano
2c996de6c3
Update install-light-es.sh 2023-05-08 22:10:36 -04:00
Maxi Zamorano
288f37c8bf
Rename install-light.sh to install-light-es.sh 2023-05-08 22:09:57 -04:00
Maxi Zamorano
ec6db72d85
Rename install-dark.sh to install-dark-es.sh 2023-05-08 22:09:37 -04:00
Maxi Zamorano
ae72071424
Update install-dark.sh 2023-05-08 21:59:13 -04:00
Maxi Zamorano
b7ad1fa6aa
Update install-light.sh 2023-05-08 21:58:50 -04:00
Maxi Zamorano
c6230b178a
Merge pull request #6 from MaxiZamorano/release-dev
Release 2.0
2023-05-08 18:35:35 -04:00
5 changed files with 662 additions and 25 deletions

132
README.md
View file

@ -1,19 +1,19 @@
<!-- <p align="center">
<p align="center">
<b>Selecciona tu idioma | Select your language</b>
</p>
<p align="center">
<a href="https://#"><img width="30" src="https://cdn-icons-png.flaticon.com/512/8363/8363059.png"></a>
<a href="https://#"><img width="30" src="https://cdn-icons-png.flaticon.com/512/197/197484.png"></a><br>
<a href="https://#">Español</a> | <a href="https://#">English</a>
</p> -->
<a href="#max-theme-para-hestiacp"><img width="30" src="https://www.maxizamorano.com/img/gh/es.png"></a>
<a href="#max-theme-for-hestiacp"><img width="30" src="https://www.maxizamorano.com/img/gh/en.png"></a><br>
<a href="#max-theme-para-hestiacp">Español</a> | <a href="#max-theme-for-hestiacp">English</a>
</p>
<p align="center">
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme2.0.png"/>
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme-2.1-es.png"/>
</p>
<h2 align="center">Max Theme para HestiaCP</h2>
<p align="center"><strong>Última versión:</strong> 2.0 | <a href="https://github.com/MaxiZamorano/maxtheme/releases">Ver Cambios</a> | <a href="#capturas">Capturas de Pantalla</a></p>
<p align="center"><strong>Última versión:</strong> 2.1 | <a href="https://github.com/MaxiZamorano/maxtheme/releases">Ver Cambios</a> | <a href="#capturas">Capturas de Pantalla</a></p>
<p align="center">
<strong>Mi web:</strong> <a target="_blank" href="https://www.maxizamorano.com/">maxizamorano.com</a> |
@ -38,11 +38,11 @@ He creado este script de fácil instalación para que puedas tener 2 nuevos tema
Para instalar los temas debes ejecutar como root los siguientes comandos en tu terminal:<br>
#### - Instalar Tema Light/Claro
```bash
curl -sSL https://raw.githubusercontent.com/maxizamorano/maxtheme/main/install-light.sh -o install.sh && sh install.sh
curl -sSL https://raw.githubusercontent.com/maxizamorano/maxtheme/main/install/light-es.sh -o install.sh && sh install.sh
```
#### - Instalar Tema Dark/Oscuro
```bash
curl -sSL https://raw.githubusercontent.com/maxizamorano/maxtheme/main/install-dark.sh -o install.sh && sh install.sh
curl -sSL https://raw.githubusercontent.com/maxizamorano/maxtheme/main/install/dark-es.sh -o install.sh && sh install.sh
```
## Notas importantes:
- Si el tema no se cambia de forma automática, debes cambiarlo desde las opciones del panel de control HestiaCP.
@ -118,3 +118,117 @@ Tienes permitido modificar el script a tu gusto o los archivos de estilos del te
## Licencia
Max Theme está bajo la licencia [GPL v3](https://github.com/MaxiZamorano/maxtheme/blob/main/LICENSE).
===========================================================================
<p align="center">
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme-2.1-en.png"/>
</p>
<h2 align="center">Max Theme for HestiaCP</h2>
<p align="center"><strong>Latest version:</strong> 2.1 | <a href="https://github.com/MaxiZamorano/maxtheme/releases">Changelog</a> | <a href="#screenshots">Screenshots</a></p>
<p align="center">
<strong>My website:</strong> <a target="_blank" href="https://www.maxizamorano.com/">maxizamorano.com</a> |
<strong>Suggestions:</strong> <a href="mailto:contacto@maxizamorano.com"> contacto@maxizamorano.com</a>
</p>
## **Welcome!**
I have created this easy to install script so you can have 2 new themes (Dark and Light) for the HestiaCP control panel with Bootstrap 5 style, it includes branding so you can include your logo at the top replacing the default HestiaCP logo.
## Features
- Dark and Light theme
- Bootstrap 5 Style Theme
- Install and uninstall without affecting the default themes
- Add your logo in the HestiaCP Dashboard (<a href="#--dashboard-with-your-logo">See example</a>)
- Add your logo on the Login screen (<a href="#--login-with-your-logo">See example</a>)
- Add a background image on the Login screen (<a href="#--login-with-your-logo-and-your-background">See example</a>)
## Installation
To install the themes you must run the following commands as root in your terminal:
#### - Install Light Theme
```bash
curl -sSL https://raw.githubusercontent.com/maxizamorano/maxtheme/main/install/light-en.sh -o install.sh && sh install.sh
```
#### - Install Dark Theme
```bash
curl -sSL https://raw.githubusercontent.com/maxizamorano/maxtheme/main/install/dark-en.sh -o install.sh && sh install.sh
```
## Important Notes:
- If the theme is not changed automatically, you must change it from the HestiaCP control panel options.
- We recommend disabling HestiaCP automatic updates.
- If the login screen styles are lost after a HestiaCP update, reinstall the theme.
- If you want to make changes to the Logo or Background you can reinstall the theme.
- If you install the 2 themes, you can change them whenever you want from the control panel options, but the login screen will have the styles of the last theme installed, for example: if the last theme you installed was the Dark theme, the login screen will continue with the Dark theme even if you switch to the Light theme, This is only for the login screen, not in the dashboard.
- To change the theme of the login screen (Dark or Light), you must reinstall the login screen theme again.
- To change the dashboard theme you just have to select it from the HestiaCP configuration options.
## Screenshots
Below, you can see some screenshots of the theme you will have for your HestiaCP dashboard.
#### - Login with your logo
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme_9.png"/>
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme_10.png"/>
#### - Login with your logo and your background
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme_7.png"/>
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme_11.png"/>
#### - Dashboard with your logo
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme_1.png"/>
<img align="center" src="https://www.maxizamorano.com/img/gh/maxtheme_13.png"/>
#### - Screenshots Max Theme Light
<table>
<tr>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_1.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_2.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_3.png"></td>
</tr>
<tr>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_4.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_5.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_6.png"></td>
</tr>
<tr>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_7.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_8.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_9.png"></td>
</tr>
</table>
#### - Screenshots Max Theme Dark
<table>
<tr>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_13.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_14.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_15.png"></td>
</tr>
<tr>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_16.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_17.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_18.png"></td>
</tr>
<tr>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_11.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_12.png"></td>
<td><img src="https://www.maxizamorano.com/img/gh/maxtheme_10.png"></td>
</tr>
</table>
## Problems and/or Suggestions
If you have any problems with the script, find any errors or have any suggestions, please contact contacto@maxizamorano.com to receive help and/or establish a conversation.
## Copyright
You are allowed to modify the script to your liking or the theme style files, if you make any major improvements you can share them and thus support the community that uses HestiaCP.
## License
Max Theme is licensed under the [GPL v3](https://github.com/MaxiZamorano/maxtheme/blob/main/LICENSE).

261
install/dark-en.sh Normal file
View file

@ -0,0 +1,261 @@
#!/bin/bash
# Colors
blanco='\033[1;37m'
verde='\033[0;32m'
amarillo='\033[1;33m'
azul='\033[0;34m'
magenta='\033[0;35m'
cyan='\033[0;36m'
gris='\033[1;30m'
negro='\033[30m'
rojo='\033[31m'
reset='\033[0m'
# Function to display the menu
show_menu() {
clear
echo ""
echo ' ___ ___ _____ _'
echo ' | \/ | |_ _| |'
echo ' | . . | __ ___ __ | | | |__ ___ _ __ ___ ___ '
echo ' | |\/| |/ _ \ \/ / | | | _ \ / _ \ _ _ \ / _ \'
echo ' | | | | (_| |> < | | | | | | __/ | | | | | __/'
echo ' \_| |_/\__,_/_/\_\ \_/ |_| |_|\___|_| |_| |_|\___|'
echo ' ___ _ '
echo ' | \ __ _ _ _| |__'
echo ' | |) / _ | _| / /'
echo ' |___/\__,_|_| |_\_\'
echo ""
echo " Max Theme Dark for HestiaCP"
echo " v2.1"
echo " www.maxizamorano.com"
echo " https://github.com/MaxiZamorano"
echo ""
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${blanco}1) Install/Reinstall${reset}"
echo "${blanco}2) Uninstall${reset}"
echo "${blanco}3) Exit${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
}
#function to install or reinstall the theme
instalar(){
url="https://raw.githubusercontent.com/maxizamorano/maxtheme/main/themes/max-theme-dark/max-theme-dark.css"
dir_archivo="/usr/local/hestia/web/css/themes/custom/max-theme-dark.css"
url_2="https://raw.githubusercontent.com/maxizamorano/maxtheme/main/themes/max-theme-dark/max-theme-dark-login.css"
dir_archivo_2="/usr/local/hestia/web/css/themes/max-theme-dark-login.css"
# Check if the folder "/usr/local/hestia/web/css/themes/custom" exists, if not create it
if [ ! -d "/usr/local/hestia/web/css/themes/custom" ]; then
mkdir -p "/usr/local/hestia/web/css/themes/custom"
fi
# Downloads the file and overwrites it if it already exists
curl -s -o "$dir_archivo" -k "$url"
curl -s -o "$dir_archivo_2" -k "$url_2"
# Check if the .copy-dark.min.css_dark file already exists
if [ -f /usr/local/hestia/web/css/themes/.copy-dark.min.css_dark ]; then
rm -rf /usr/local/hestia/web/css/themes/dark.min.css
cp /usr/local/hestia/web/css/themes/max-theme-dark-login.css /usr/local/hestia/web/css/themes/dark.min.css
rm -rf /usr/local/hestia/web/css/themes/max-theme-dark-login.css
else
cp /usr/local/hestia/web/css/themes/dark.min.css /usr/local/hestia/web/css/themes/.copy-dark.min.css_dark
rm -rf /usr/local/hestia/web/css/themes/dark.min.css
cp /usr/local/hestia/web/css/themes/max-theme-dark-login.css /usr/local/hestia/web/css/themes/dark.min.css
rm -rf /usr/local/hestia/web/css/themes/max-theme-dark-login.css
fi
archivo="/usr/local/hestia/web/css/themes/custom/max-theme-dark.css"
linea="5"
css_inicio=' background-image: url("'
css_final='");'
archivo_2="/usr/local/hestia/web/css/themes/dark.min.css"
linea_2="594"
css_inicio_2=' background-image: url("'
css_final_2='");'
linea_3="603"
css_inicio_3=' background-image: url("'
css_final_3='");'
css_color_fondo=' background: #10161f;'
# Asks the URL of the logo for the dashboard
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${amarillo}LOGO FOR THE TOP BAR OF THE DASHBOARD ${reset}"
echo ""
echo "${cyan}We recommend that your logo be in a ${amarillo}PNG, SVG or Webp ${cyan}format.${reset}"
echo "${cyan}Use a correct URL format and in https, for example: ${amarillo}https://example.com/img/your-logo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Paste or type the URL of your logo: ${reset}"
read url_logo
url=$(echo $url_logo | sed 's/\//\\\//g')
sed -i "${linea}s/.*/$css_inicio${url}$css_final/" $archivo
# Asks the URL of the logo for the login
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${amarillo}LOGO FOR THE LOGIN SCREEN ${reset}"
echo ""
echo "${cyan}We recommend that your logo be in a ${amarillo}PNG, SVG or Webp ${cyan}format.${reset}"
echo "${cyan}Use a correct URL format and in https, for example: ${amarillo}https://example.com/img/your-logo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Paste or type the URL of your logo: ${reset}"
read url_logo_login
url_2=$(echo $url_logo_login | sed 's/\//\\\//g')
sed -i "${linea_2}s/.*/$css_inicio_2${url_2}$css_final_2/" $archivo_2
# Ask the background URL
while true; do
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Do you want to add a background image at login? [Y/N]:${reset} "
read respuesta
case "$respuesta" in
[Yy]* )
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${amarillo}BACKGROUND IMAGE FOR THE LOGIN SCREEN ${reset}"
echo ""
echo "${cyan}We recommend that the image have a resolution of ${amarillo}1920x1080px ${cyan}and be in ${amarillo}PNG, JPG or Webp ${cyan}format${reset}"
echo "${cyan}Use a correct URL format and in https, for example: ${amarillo}https://example.com/img/your-background.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Paste or type the URL of the background image: ${reset}"
read url_img_fondo
url_3=$(echo $url_img_fondo | sed 's/\//\\\//g')
sed -i "${linea_3}s/.*/$css_inicio_3${url_3}$css_final_3/" $archivo_2
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} THEME INSTALLED SUCCESSFULLY! ${reset}"
echo "${cyan} NOTE: ${amarillo}If the theme is not changed automatically, you must change it from the control panel. ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
exit
;;
[Nn]* )
sed -i "${linea_3}s/.*/$css_color_fondo/" $archivo_2
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} THEME INSTALLED SUCCESSFULLY! ${reset}"
echo "${cyan} NOTE: ${amarillo}If the theme is not changed automatically, you must change it from the control panel. ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
exit
;;
* )
echo ""
echo "${rojo}The answer is invalid, you must answer with "Y/N or y/n".${reset}"
;;
esac
done
}
#function to uninstall the theme
desinstalar(){
# It asks if you want to uninstall the theme
while true; do
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${cyan}NOTE:${reset} If you uninstall it we will restore the original files and the default HestiaCP theme will be activated."
echo ""
echo -n "${verde}Do you want to uninstall Max Theme Dark theme? [Y/N]:${reset} "
read respuesta
case "$respuesta" in
[Yy]* )
# Check if the theme is currently installed
if [ -f /usr/local/hestia/web/css/themes/.copy-dark.min.css_dark ]; then
# Delete the files and restore the original
rm -rf /usr/local/hestia/web/css/themes/dark.min.css
cp /usr/local/hestia/web/css/themes/.copy-dark.min.css_dark /usr/local/hestia/web/css/themes/dark.min.css
rm /usr/local/hestia/web/css/themes/.copy-dark.min.css_dark
rm -rf /usr/local/hestia/web/css/themes/custom/max-theme-dark.css
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} THEME UNINSTALLED SUCCESSFULLY! ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
exit
else
echo ""
echo "${rojo}You don't have the theme installed! We can only uninstall it if the theme was previously installed.${reset}"
echo ""
exit
fi
;;
[Nn]* )
# Doesn't uninstall the theme
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} GREAT! CONTINUE WITH YOUR THEME ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
exit
;;
* )
echo ""
echo "${rojo}The answer is invalid, you must answer with "Y/N or y/n".${reset}"
;;
esac
done
}
# Loop for user response
while true; do
# show menu
show_menu
# Read the option selected by the user
echo -n "${verde}Select an option [1-3]: ${reset}"
read opcion
# Evaluate the selected option
case $opcion in
1)
instalar
;;
2)
desinstalar
;;
3)
exit
;;
*)
echo "${rojo}Invalid option. Try again.${reset}"
sleep 3
;;
esac
done

View file

@ -29,7 +29,7 @@ show_menu() {
echo ""
echo " Max Theme Dark para HestiaCP"
echo " v2.0"
echo " v2.1"
echo " www.maxizamorano.com"
echo " https://github.com/MaxiZamorano"
echo ""
@ -47,10 +47,10 @@ show_menu() {
#función para instalar o reinstalar el tema
instalar(){
url="https://raw.githubusercontent.com/maxizamorano/maxtheme/release-dev/themes/max-theme-dark/max-theme-dark.css"
url="https://raw.githubusercontent.com/maxizamorano/maxtheme/main/themes/max-theme-dark/max-theme-dark.css"
dir_archivo="/usr/local/hestia/web/css/themes/custom/max-theme-dark.css"
url_2="https://raw.githubusercontent.com/maxizamorano/maxtheme/release-dev/themes/max-theme-dark/max-theme-dark-login.css"
url_2="https://raw.githubusercontent.com/maxizamorano/maxtheme/main/themes/max-theme-dark/max-theme-dark-login.css"
dir_archivo_2="/usr/local/hestia/web/css/themes/max-theme-dark-login.css"
# Verifica si la carpeta "/usr/local/hestia/web/css/themes/custom" existe, si no la crea
@ -95,7 +95,7 @@ instalar(){
echo "${amarillo}LOGO PARA LA BARRA SUPERIOR DEL DASHBOARD ${reset}"
echo ""
echo "${cyan}Se recomienda que tu logo esté en formato ${amarillo}PNG, SVG o Webp${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejmplo: ${amarillo}https://example.com/img/tu-logo.png${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejemplo: ${amarillo}https://example.com/img/tu-logo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Pega o escribe la URL de tu logo: ${reset}"
@ -111,7 +111,7 @@ instalar(){
echo "${amarillo}LOGO PARA LA PANTALLA DE LOGIN O INICIO DE SESIÓN ${reset}"
echo ""
echo "${cyan}Se recomienda que tu logo esté en formato ${amarillo}PNG, SVG o Webp${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejmplo: ${amarillo}https://example.com/img/tu-logo.png${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejemplo: ${amarillo}https://example.com/img/tu-logo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Pega o escribe la URL de tu logo: ${reset}"
@ -135,7 +135,7 @@ instalar(){
echo "${amarillo}IMAGEN DE FONDO PARA LA PANTALLA DE LOGIN O INICIO DE SESIÓN ${reset}"
echo ""
echo "${cyan}Se recomienda que la imagen tenga una resolución de ${amarillo}1920x1080px ${cyan}y esté en formato ${amarillo}PNG, JPG o Webp${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejmplo: ${amarillo}https://example.com/img/tu-fondo.png${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejemplo: ${amarillo}https://example.com/img/tu-fondo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Pega o escribe la URL de la imagen de fondo: ${reset}"
@ -147,7 +147,7 @@ instalar(){
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} ¡TEMA INSTALADO CORRECTAMENTE! ${reset}"
echo "${cyan} NOTA: ${amarillo}si no se cambia el tema automaticamente, debes cambiarlo desde el panel de control. ${reset}"
echo "${cyan} NOTA: ${amarillo}si no se cambia el tema automáticamente, debes cambiarlo desde el panel de control. ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
@ -159,7 +159,7 @@ instalar(){
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} ¡TEMA INSTALADO CORRECTAMENTE! ${reset}"
echo "${cyan} NOTA: ${amarillo}si no se cambia el tema automaticamente, debes cambiarlo desde el panel de control. ${reset}"
echo "${cyan} NOTA: ${amarillo}si no se cambia el tema automáticamente, debes cambiarlo desde el panel de control. ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""

262
install/light-en.sh Normal file
View file

@ -0,0 +1,262 @@
#!/bin/bash
# Colors
blanco='\033[1;37m'
verde='\033[0;32m'
amarillo='\033[1;33m'
azul='\033[0;34m'
magenta='\033[0;35m'
cyan='\033[0;36m'
gris='\033[1;30m'
negro='\033[30m'
rojo='\033[31m'
reset='\033[0m'
# Function to display the menu
show_menu() {
clear
echo ""
echo ' ___ ___ _____ _'
echo ' | \/ | |_ _| |'
echo ' | . . | __ ___ __ | | | |__ ___ _ __ ___ ___ '
echo ' | |\/| |/ _ \ \/ / | | | _ \ / _ \ _ _ \ / _ \'
echo ' | | | | (_| |> < | | | | | | __/ | | | | | __/'
echo ' \_| |_/\__,_/_/\_\ \_/ |_| |_|\___|_| |_| |_|\___|'
echo " _ _ _ _"
echo " | | (_)__ _| |_| |_"
echo " | |__| / _' | ' \ _|"
echo " |____|_\__, |_||_\__|"
echo " |___/"
echo ""
echo " Max Theme Light for HestiaCP"
echo " v2.1"
echo " www.maxizamorano.com"
echo " https://github.com/MaxiZamorano"
echo ""
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${blanco}1) Install/Reinstall${reset}"
echo "${blanco}2) Uninstall${reset}"
echo "${blanco}3) Exit${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
}
#function to install or reinstall the theme
instalar(){
url="https://raw.githubusercontent.com/maxizamorano/maxtheme/main/themes/max-theme-light/max-theme-light.css"
dir_archivo="/usr/local/hestia/web/css/themes/custom/max-theme-light.css"
url_2="https://raw.githubusercontent.com/maxizamorano/maxtheme/main/themes/max-theme-light/max-theme-light-login.css"
dir_archivo_2="/usr/local/hestia/web/css/themes/max-theme-light-login.css"
# Check if the folder "/usr/local/hestia/web/css/themes/custom" exists, if not create it
if [ ! -d "/usr/local/hestia/web/css/themes/custom" ]; then
mkdir -p "/usr/local/hestia/web/css/themes/custom"
fi
# Downloads the file and overwrites it if it already exists
curl -s -o "$dir_archivo" -k "$url"
curl -s -o "$dir_archivo_2" -k "$url_2"
# Check if the .copy-dark.min.css_dark file already exists
if [ -f /usr/local/hestia/web/css/themes/.copy-dark.min.css_light ]; then
rm -rf /usr/local/hestia/web/css/themes/dark.min.css
cp /usr/local/hestia/web/css/themes/max-theme-light-login.css /usr/local/hestia/web/css/themes/dark.min.css
rm -rf /usr/local/hestia/web/css/themes/max-theme-light-login.css
else
cp /usr/local/hestia/web/css/themes/dark.min.css /usr/local/hestia/web/css/themes/.copy-dark.min.css_light
rm -rf /usr/local/hestia/web/css/themes/dark.min.css
cp /usr/local/hestia/web/css/themes/max-theme-light-login.css /usr/local/hestia/web/css/themes/dark.min.css
rm -rf /usr/local/hestia/web/css/themes/max-theme-light-login.css
fi
archivo="/usr/local/hestia/web/css/themes/custom/max-theme-light.css"
linea="5"
css_inicio=' background-image: url("'
css_final='");'
archivo_2="/usr/local/hestia/web/css/themes/dark.min.css"
linea_2="594"
css_inicio_2=' background-image: url("'
css_final_2='");'
linea_3="603"
css_inicio_3=' background-image: url("'
css_final_3='");'
css_color_fondo=' background: #f6f6f6;'
# Asks the URL of the logo for the dashboard
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${amarillo}LOGO FOR THE TOP BAR OF THE DASHBOARD ${reset}"
echo ""
echo "${cyan}We recommend that your logo be in a ${amarillo}PNG, SVG or Webp ${cyan}format.${reset}"
echo "${cyan}Use a correct URL format and in https, for example: ${amarillo}https://example.com/img/your-logo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Paste or type the URL of your logo: ${reset}"
read url_logo
url=$(echo $url_logo | sed 's/\//\\\//g')
sed -i "${linea}s/.*/$css_inicio${url}$css_final/" $archivo
# Asks the URL of the logo for the login
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${amarillo}LOGO FOR THE LOGIN SCREEN ${reset}"
echo ""
echo "${cyan}We recommend that your logo be in a ${amarillo}PNG, SVG or Webp ${cyan}format.${reset}"
echo "${cyan}Use a correct URL format and in https, for example: ${amarillo}https://example.com/img/your-logo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Paste or type the URL of your logo: ${reset}"
read url_logo_login
url_2=$(echo $url_logo_login | sed 's/\//\\\//g')
sed -i "${linea_2}s/.*/$css_inicio_2${url_2}$css_final_2/" $archivo_2
# Ask the background URL
while true; do
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Do you want to add a background image at login? [Y/N]:${reset} "
read respuesta
case "$respuesta" in
[Yy]* )
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${amarillo}BACKGROUND IMAGE FOR THE LOGIN SCREEN ${reset}"
echo ""
echo "${cyan}We recommend that the image have a resolution of ${amarillo}1920x1080px ${cyan}and be in ${amarillo}PNG, JPG or Webp ${cyan}format${reset}"
echo "${cyan}Use a correct URL format and in https, for example: ${amarillo}https://example.com/img/your-background.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Paste or type the URL of the background image: ${reset}"
read url_img_fondo
url_3=$(echo $url_img_fondo | sed 's/\//\\\//g')
sed -i "${linea_3}s/.*/$css_inicio_3${url_3}$css_final_3/" $archivo_2
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} THEME INSTALLED SUCCESSFULLY! ${reset}"
echo "${cyan} NOTE: ${amarillo}If the theme is not changed automatically, you must change it from the control panel. ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
exit
;;
[Nn]* )
sed -i "${linea_3}s/.*/$css_color_fondo/" $archivo_2
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} THEME INSTALLED SUCCESSFULLY! ${reset}"
echo "${cyan} NOTE: ${amarillo}If the theme is not changed automatically, you must change it from the control panel. ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
exit
;;
* )
echo ""
echo "${rojo}The answer is invalid, you must answer with "Y/N or y/n".${reset}"
;;
esac
done
}
#function to uninstall the theme
desinstalar(){
# It asks if you want to uninstall the theme
while true; do
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${cyan}NOTE:${reset} If you uninstall it we will restore the original files and the default HestiaCP theme will be activated."
echo ""
echo -n "${verde}Do you want to uninstall Max Theme Dark theme? [Y/N]:${reset} "
read respuesta
case "$respuesta" in
[Yy]* )
# Check if the theme is currently installed
if [ -f /usr/local/hestia/web/css/themes/.copy-dark.min.css_light ]; then
# Delete the files and restore the original
rm -rf /usr/local/hestia/web/css/themes/dark.min.css
cp /usr/local/hestia/web/css/themes/.copy-dark.min.css_light /usr/local/hestia/web/css/themes/dark.min.css
rm /usr/local/hestia/web/css/themes/.copy-dark.min.css_light
rm -rf /usr/local/hestia/web/css/themes/custom/max-theme-light.css
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} THEME UNINSTALLED SUCCESSFULLY! ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
exit
else
echo ""
echo "${rojo}You don't have the theme installed! We can only uninstall it if the theme was previously installed.${reset}"
echo ""
exit
fi
;;
[Nn]* )
# Doesn't uninstall the theme
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} GREAT! CONTINUE WITH YOUR THEME ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
exit
;;
* )
echo ""
echo "${rojo}The answer is invalid, you must answer with "Y/N or y/n".${reset}"
;;
esac
done
}
# Loop for user response
while true; do
# show menu
show_menu
# Read the option selected by the user
echo -n "${verde}Select an option [1-3]: ${reset}"
read opcion
# Evaluate the selected option
case $opcion in
1)
instalar
;;
2)
desinstalar
;;
3)
exit
;;
*)
echo "${rojo}Invalid option. Try again.${reset}"
sleep 3
;;
esac
done

View file

@ -30,7 +30,7 @@ show_menu() {
echo ""
echo " Max Theme Light para HestiaCP"
echo " v2.0"
echo " v2.1"
echo " www.maxizamorano.com"
echo " https://github.com/MaxiZamorano"
echo ""
@ -48,10 +48,10 @@ show_menu() {
#función para instalar o reinstalar el tema
instalar(){
url="https://raw.githubusercontent.com/maxizamorano/maxtheme/release-dev/themes/max-theme-light/max-theme-light.css"
url="https://raw.githubusercontent.com/maxizamorano/maxtheme/main/themes/max-theme-light/max-theme-light.css"
dir_archivo="/usr/local/hestia/web/css/themes/custom/max-theme-light.css"
url_2="https://raw.githubusercontent.com/maxizamorano/maxtheme/release-dev/themes/max-theme-light/max-theme-light-login.css"
url_2="https://raw.githubusercontent.com/maxizamorano/maxtheme/main/themes/max-theme-light/max-theme-light-login.css"
dir_archivo_2="/usr/local/hestia/web/css/themes/max-theme-light-login.css"
# Verifica si la carpeta "/usr/local/hestia/web/css/themes/custom" existe, si no la crea
@ -96,7 +96,7 @@ instalar(){
echo "${amarillo}LOGO PARA LA BARRA SUPERIOR DEL DASHBOARD ${reset}"
echo ""
echo "${cyan}Se recomienda que tu logo esté en formato ${amarillo}PNG, SVG o Webp${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejmplo: ${amarillo}https://example.com/img/tu-logo.png${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejemplo: ${amarillo}https://example.com/img/tu-logo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Pega o escribe la URL de tu logo: ${reset}"
@ -112,7 +112,7 @@ instalar(){
echo "${amarillo}LOGO PARA LA PANTALLA DE LOGIN O INICIO DE SESIÓN ${reset}"
echo ""
echo "${cyan}Se recomienda que tu logo esté en formato ${amarillo}PNG, SVG o Webp${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejmplo: ${amarillo}https://example.com/img/tu-logo.png${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejemplo: ${amarillo}https://example.com/img/tu-logo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Pega o escribe la URL de tu logo: ${reset}"
@ -136,7 +136,7 @@ instalar(){
echo "${amarillo}IMAGEN DE FONDO PARA LA PANTALLA DE LOGIN O INICIO DE SESIÓN ${reset}"
echo ""
echo "${cyan}Se recomienda que la imagen tenga una resolución de ${amarillo}1920x1080px ${cyan}y esté en formato ${amarillo}PNG, JPG o Webp${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejmplo: ${amarillo}https://example.com/img/tu-fondo.png${reset}"
echo "${cyan}Utiliza un formato de URL correcto y en https, por ejemplo: ${amarillo}https://example.com/img/tu-fondo.png${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo -n "${verde}Pega o escribe la URL de la imagen de fondo: ${reset}"
@ -148,7 +148,7 @@ instalar(){
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} ¡TEMA INSTALADO CORRECTAMENTE! ${reset}"
echo "${cyan} NOTA: ${amarillo}si no se cambia el tema automaticamente, debes cambiarlo desde el panel de control. ${reset}"
echo "${cyan} NOTA: ${amarillo}si no se cambia el tema automáticamente, debes cambiarlo desde el panel de control. ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
@ -160,7 +160,7 @@ instalar(){
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""
echo "${verde} ¡TEMA INSTALADO CORRECTAMENTE! ${reset}"
echo "${cyan} NOTA: ${amarillo}si no se cambia el tema automaticamente, debes cambiarlo desde el panel de control. ${reset}"
echo "${cyan} NOTA: ${amarillo}si no se cambia el tema automáticamente, debes cambiarlo desde el panel de control. ${reset}"
echo "${gris}____________________________________________________________________________________________________${reset}"
echo ""