diff --git a/doc_templates/bash.sh b/doc_templates/bash.sh new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/docker-compose.yml b/doc_templates/docker-compose.yml new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/env.example b/doc_templates/env.example new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/index.html b/doc_templates/index.html new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/java.js b/doc_templates/java.js new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/json.json b/doc_templates/json.json new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/pyton.py b/doc_templates/pyton.py new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/readme.md b/doc_templates/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/styles.css b/doc_templates/styles.css new file mode 100644 index 0000000..e69de29 diff --git a/doc_templates/texto.txt b/doc_templates/texto.txt new file mode 100644 index 0000000..e69de29 diff --git a/modules/doc_templates.sh b/modules/doc_templates.sh new file mode 100755 index 0000000..a2032fa --- /dev/null +++ b/modules/doc_templates.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# +# Módulo para copiar plantillas de documentos al directorio ~/Templates. +# + +SCRIPT_DIR_MODULE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SCRIPT_DIR_ROOT="$(cd "${SCRIPT_DIR_MODULE}/.." && pwd)" + +if [[ -f "${SCRIPT_DIR_MODULE}/common.sh" ]]; then + source "${SCRIPT_DIR_MODULE}/common.sh" +else + echo "Error: common.sh no encontrado." + exit 1 +fi + +install_doc_templates() { + log_step "Copiando plantillas de documentos" + + local src_dir="${SCRIPT_DIR_ROOT}/doc_templates" + if [[ ! -d "$src_dir" ]]; then + log_error "El directorio de plantillas no existe: ${src_dir}" + return 1 + fi + + local target_user="${SUDO_USER:-$USER}" + local target_home="$HOME" + if [[ -n "${SUDO_USER:-}" ]]; then + target_home="$(getent passwd "$target_user" 2>/dev/null | cut -d: -f6)" + if [[ -z "$target_home" ]]; then + target_home="$(eval echo "~${target_user}")" + fi + fi + target_home="${target_home:-$HOME}" + + local dest_dir="${target_home}/Templates" + if [[ ! -d "$dest_dir" ]]; then + log_info "Creando directorio ${dest_dir}..." + if ! mkdir -p "$dest_dir"; then + log_error "No se pudo crear el directorio destino." + return 1 + fi + fi + + if ! cp -a "${src_dir}/." "$dest_dir/"; then + log_error "No se pudieron copiar las plantillas a ${dest_dir}" + return 1 + fi + + log_success "Plantillas copiadas a ${dest_dir}" +} diff --git a/omarchy-setup.sh b/omarchy-setup.sh index 77ed478..52316ec 100755 --- a/omarchy-setup.sh +++ b/omarchy-setup.sh @@ -136,6 +136,7 @@ MODULES=( ["F"]="disk-format;run_module_main;💾 Habilitar Formatos FAT/exFAT/NTFS/ext4;bg" ["R"]="davinci-resolve;install_davinci_resolve;🎬 Instalar DaVinci Resolve (Intel Edition);fg" ["H"]="hyprland-config;run_module_main;🎨 Instalar Configuración de Hyprland;bg" + ["T"]="doc_templates;install_doc_templates;📄 Copiar Plantillas de Documentos a ~/Templates;bg" ) # Módulos a excluir de la opción "Instalar Todo"