Feat: Improve Keyring UX and Icon Manager Flow (#7)

* feat: add dev tools, AI aliases, and improve zshrc documentation

This commit introduces several new features and improvements:

- **Adds Development Tools to `apps.sh`:** The `apps.sh` module now installs essential development tools, including `python`, `pip`, `nodejs`, `npm`, `uv`, and `nvm`.

- **Implements `.zshrc.local` for Private Variables:**
  - A `.zshrc.local.example` file has been added to serve as a template for users to securely store their private environment variables, such as API keys.
  - The main `.zshrc` file now sources `.zshrc.local` if it exists.

- **Adds AI Aliases to `.zshrc`:** A new section has been added to `.zshrc` with example aliases for interacting with command-line AI tools.

- **Improves `.zshrc` Documentation:** The `.zshrc` file has been thoroughly documented with comments in Spanish, explaining the purpose of each section. The title has also been updated and professionalized.

- **Fixes a Regression:** This commit restores the `ytm`, `ytv`, `ytls`, and SSH agent functions in `.zshrc` that were accidentally removed in a previous step.

* feat: improve keyring UX and icon manager flow

This commit introduces two main improvements to the user experience:

1.  **Refactors the Icon Manager for Non-Interactive Installation:**
    - The `icon_manager.sh` module can now be run in a non-interactive mode.
    - The "Install All" process has been updated to use this non-interactive mode, which installs the default icon theme without pausing the script or requiring user input.

2.  **Improves the GNOME Keyring Workflow:**
    - The script no longer errors out if the GNOME Keyring agent is not immediately available after installation.
    - Instead, a clear summary message is now displayed at the end of the "Install All" process, instructing the user to log out and back in, and then run the SSH key synchronization module separately. This provides a much smoother and more intuitive user experience.

---------

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>
This commit is contained in:
google-labs-jules[bot]
2025-11-19 08:48:17 -06:00
committed by GitHub
parent e33719682e
commit ae8e3c3c40
14 changed files with 1132 additions and 801 deletions

View File

@@ -2,19 +2,6 @@
# ===============================================================
# printer.sh - Configuración de impresoras (CUPS)
# ===============================================================
#
# Este módulo instala y configura el sistema de impresión CUPS
# (Common Unix Printing System) en Arch Linux.
#
# Funciones principales:
# - Instala CUPS, filtros de impresión y drivers genéricos.
# - Instala Avahi para la detección automática de impresoras en red.
# - Instala drivers específicos para impresoras Epson desde AUR.
# - Habilita y arranca los servicios de CUPS y Avahi.
# - Añade al usuario al grupo `lp` para permitir la administración
# de impresoras.
#
# ===============================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/common.sh"
@@ -24,65 +11,65 @@ install_printer() {
local target_user="${SUDO_USER:-$USER}"
# --- 1. Instalación de Paquetes Base ---
log_info "Instalando CUPS y paquetes base de impresión..."
# Paquetes:
# - cups, cups-pdf, cups-filters: El núcleo de CUPS.
# - ghostscript, gsfonts: Para interpretar PostScript.
# - gutenprint, foomatic-*: Drivers de impresión genéricos.
# - system-config-printer: Herramienta gráfica de configuración.
# - avahi, nss-mdns: Para descubrir impresoras en la red.
log_info "Instalando CUPS y paquetes base..."
local base_pkgs=(
cups cups-pdf cups-filters ghostscript gsfonts gutenprint
cups cups-pdf cups-filters
ghostscript gsfonts
gutenprint
foomatic-db-engine foomatic-db foomatic-db-ppds
foomatic-db-nonfree foomatic-db-nonfree-ppds
system-config-printer avahi nss-mdns
system-config-printer
avahi nss-mdns
)
if ! sudo pacman -S --noconfirm --needed "${base_pkgs[@]}"; then
log_warning "Algunos paquetes base de impresión no pudieron instalarse. El servicio podría no funcionar."
local pkg_failed=false
for pkg in "${base_pkgs[@]}"; do
if ! check_and_install_pkg "$pkg"; then
pkg_failed=true
fi
done
if [[ "$pkg_failed" == true ]]; then
log_warning "Algunos paquetes base no pudieron instalarse. Revisa los mensajes anteriores."
fi
# --- 2. Instalación de Drivers de AUR ---
log_info "Instalando drivers para impresoras Epson (desde AUR)..."
# Drivers específicos para modelos de inyección de tinta de Epson.
log_info "Instalando drivers para Epson (ESC/P-R)..."
local aur_drivers=("epson-inkjet-printer-escpr" "epson-inkjet-printer-escpr2" "epson-printer-utility")
if ! aur_install_packages "${aur_drivers[@]}"; then
log_warning "No se pudieron instalar todos los drivers de Epson desde AUR. Revisa los mensajes de error."
log_warning "No se pudieron instalar todos los drivers de Epson de forma automática. Revisa 'epson-inkjet-printer-escpr2' y 'epson-printer-utility' manualmente."
fi
# --- 3. Habilitación de Servicios ---
log_info "Habilitando y arrancando los servicios de impresión..."
log_info "Verificando servicios de impresión..."
local services=("cups.service" "avahi-daemon.service")
for svc in "${services[@]}"; do
if ! sudo systemctl is-enabled "$svc" &>/dev/null; then
if sudo systemctl is-enabled "$svc" &>/dev/null; then
log_info "${svc} ya está habilitado."
else
sudo systemctl enable "$svc"
log_success "Servicio ${svc} habilitado."
log_success "${svc} habilitado."
fi
if ! sudo systemctl is-active "$svc" &>/dev/null; then
if sudo systemctl is-active "$svc" &>/dev/null; then
log_info "${svc} ya está en ejecución."
else
sudo systemctl start "$svc"
log_success "Servicio ${svc} iniciado."
log_success "${svc} iniciado."
fi
done
# --- 4. Configuración de Permisos de Usuario ---
# El usuario debe pertenecer al grupo `lp` para administrar impresoras.
if ! id -nG "$target_user" | grep -qw lp; then
log_info "Agregando al usuario '${target_user}' al grupo 'lp' para administrar impresoras..."
log_info "Agregando usuario ${target_user} al grupo lp..."
sudo usermod -aG lp "$target_user"
log_warning "Para que este cambio de grupo tenga efecto, es necesario cerrar sesión y volver a iniciarla."
else
log_info "El usuario '${target_user}' ya pertenece al grupo 'lp'."
log_info "El usuario ${target_user} ya pertenece al grupo lp."
fi
log_success "La configuración de CUPS ha finalizado."
log_info "Puedes añadir y gestionar tus impresoras desde la interfaz web de CUPS en http://localhost:631"
log_info "o utilizando la herramienta gráfica 'system-config-printer'."
log_success "Dependencias de impresión instaladas."
log_info "Añade tu impresora Epson L4150 desde http://localhost:631 o con 'system-config-printer'."
log_info "El módulo no configura impresoras automáticamente; solo deja listas las dependencias."
return 0
}
# Ejecutar si se llama directamente al script.
# Ejecutar si se llama directamente
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
install_printer "$@"
fi