mirror of
https://github.com/marcogll/omarchy_setup.git
synced 2026-01-13 13:25:16 +00:00
* docs: update and improve Readme.md in Spanish Restore the comprehensive Spanish version of the `Readme.md` and add a new section with instructions for installing the Meslo font, which is required for the `oh-my-posh` theme to render correctly. The new section is located in the "Troubleshooting" area and provides the necessary command (`oh-my-posh font install meslo`) to ensure a correct setup. The rest of the document has been reviewed to ensure it is complete and accurately reflects the script's functionality. * refactor: improve and document all modules and Readme.md This is a major refactoring and documentation effort that touches every module in the project. - **Exhaustive In-Code Documentation:** Every module script in the `modules/` directory has been updated with detailed comments. This includes header descriptions, explanations for each function, and justifications for complex logic. This greatly improves the maintainability and readability of the code. - **Code Robustness and Optimization:** Several modules have been refactored to be more robust and efficient. This includes: - Optimizing package installations by grouping them into a single `pacman` command. - Improving dependency checks. - Standardizing the use of helper functions from `common.sh`. - Making network operations more resilient. - **Comprehensive `Readme.md` Update:** The main `Readme.md` has been rewritten to be a complete and professional guide to the project. It now includes: - A clear and detailed description of each module. - Information on what each module installs and how it works. - Instructions for installing the required Nerd Font for `oh-my-posh`. - An updated structure that is easier to navigate. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Marco Gallegos <marco.gallegos@outlook.com>
71 lines
2.8 KiB
Bash
Executable File
71 lines
2.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# ===============================================================
|
|
# hyprland-config.sh - Instala la configuración personalizada de Hyprland
|
|
# ===============================================================
|
|
#
|
|
# Este módulo se encarga de instalar una configuración personalizada
|
|
# para el gestor de ventanas Hyprland.
|
|
#
|
|
# Funciones principales:
|
|
# - Realiza una copia de seguridad de la configuración existente de
|
|
# Hyprland en ~/.config/hypr.
|
|
# - Copia la nueva configuración desde la carpeta `hypr_config`
|
|
# del repositorio a ~/.config/hypr.
|
|
# - Establece un tema de iconos por defecto, utilizando para ello
|
|
# funciones del módulo `icon_manager.sh`.
|
|
#
|
|
# ===============================================================
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "${SCRIPT_DIR}/common.sh"
|
|
|
|
# Se carga el módulo `icon_manager.sh` para poder utilizar su
|
|
# función `set_default_icon_theme`.
|
|
source "${SCRIPT_DIR}/icon_manager.sh"
|
|
|
|
run_module_main() {
|
|
log_step "Instalación de la Configuración de Hyprland"
|
|
|
|
# --- 1. Copia de Archivos de Configuración ---
|
|
# La configuración que se va a instalar debe estar en una carpeta
|
|
# llamada `hypr_config` en la raíz del repositorio.
|
|
local source_dir="${SCRIPT_DIR}/../hypr_config"
|
|
local dest_dir="$HOME/.config/hypr"
|
|
|
|
if [[ ! -d "$source_dir" ]]; then
|
|
log_error "No se encontró el directorio de configuración 'hypr_config'."
|
|
log_info "Asegúrate de que la carpeta con tu configuración de Hyprland exista en la raíz del repositorio."
|
|
return 1
|
|
fi
|
|
|
|
# Se crea una copia de seguridad de la configuración existente antes de sobrescribirla.
|
|
# Se utiliza la función `backup_file` definida en `common.sh`.
|
|
if ! backup_file "$dest_dir"; then
|
|
return 1
|
|
fi
|
|
|
|
log_info "Copiando la configuración de Hyprland a ${dest_dir}..."
|
|
# Se usa `rsync` para una copia eficiente que muestra el progreso.
|
|
if ! rsync -a --info=progress2 "$source_dir/" "$dest_dir/"; then
|
|
log_error "No se pudo copiar la configuración de Hyprland."
|
|
return 1
|
|
fi
|
|
|
|
# --- 2. Establecimiento del Tema de Iconos ---
|
|
log_info "Estableciendo el tema de iconos por defecto (Tela Nord)..."
|
|
# Llama a una función del módulo `icon_manager.sh`.
|
|
if ! set_default_icon_theme; then
|
|
log_warning "No se pudo establecer el tema de iconos por defecto."
|
|
# No es un error fatal, la configuración principal ya se copió.
|
|
fi
|
|
|
|
log_success "La configuración de Hyprland se ha instalado correctamente."
|
|
log_warning "Para que los cambios se apliquen, por favor, cierra sesión y vuelve a iniciarla."
|
|
return 0
|
|
}
|
|
|
|
# Ejecutar si se llama directamente al script.
|
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
run_module_main "$@"
|
|
fi
|