Files
omarchy_setup/modules/printer.sh
google-labs-jules[bot] ae8e3c3c40 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>
2025-11-19 08:48:17 -06:00

76 lines
2.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# ===============================================================
# printer.sh - Configuración de impresoras (CUPS)
# ===============================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/common.sh"
install_printer() {
log_step "Configuración de Impresoras (CUPS)"
local target_user="${SUDO_USER:-$USER}"
log_info "Instalando CUPS y paquetes base..."
local base_pkgs=(
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
)
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
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 de forma automática. Revisa 'epson-inkjet-printer-escpr2' y 'epson-printer-utility' manualmente."
fi
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
log_info "${svc} ya está habilitado."
else
sudo systemctl enable "$svc"
log_success "${svc} habilitado."
fi
if sudo systemctl is-active "$svc" &>/dev/null; then
log_info "${svc} ya está en ejecución."
else
sudo systemctl start "$svc"
log_success "${svc} iniciado."
fi
done
if ! id -nG "$target_user" | grep -qw lp; then
log_info "Agregando usuario ${target_user} al grupo lp..."
sudo usermod -aG lp "$target_user"
else
log_info "El usuario ${target_user} ya pertenece al grupo lp."
fi
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
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
install_printer "$@"
fi