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,123 +2,75 @@
# ===============================================================
# mouse_cursor.sh - Instala y configura el tema de cursor Bibata
# ===============================================================
#
# Este módulo automatiza la descarga, instalación y configuración
# del tema de cursor "Bibata-Modern-Ice".
#
# Funciones principales:
# - Descarga el tema de cursor desde su repositorio de GitHub.
# - Lo instala en el directorio ~/.icons del usuario.
# - Configura el cursor para Hyprland, modificando el fichero
# `~/.config/hypr/envs.conf`.
# - Configura el cursor para aplicaciones GTK a través de `gsettings`.
#
# Dependencias: curl, tar, gsettings (parte de glib2).
#
# ===============================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/common.sh"
# ---------------------------------------------------------------
# check_cursor_deps()
# ---------------------------------------------------------------
# Verifica que las dependencias necesarias para este módulo estén
# instaladas.
# ---------------------------------------------------------------
check_cursor_deps() {
local missing_deps=0
for cmd in curl tar gsettings; do
if ! command_exists "$cmd"; then
log_error "El comando '$cmd' es necesario pero no está instalado."
((missing_deps++))
fi
done
return $missing_deps
}
# ---------------------------------------------------------------
# install_mouse_cursor()
# ---------------------------------------------------------------
# Orquesta todo el proceso de instalación y configuración del cursor.
# ---------------------------------------------------------------
install_mouse_cursor() {
log_step "Instalación del Tema de Cursor (Bibata-Modern-Ice)"
if ! check_cursor_deps; then
return 1
fi
# --- Variables de Configuración ---
# --- Variables ---
local CURSOR_THEME='Bibata-Modern-Ice'
local CURSOR_SIZE=24
local HYPR_CONFIG_DIR="$HOME/.config/hypr"
local ENVS_FILE="${HYPR_CONFIG_DIR}/envs.conf"
local ENVS_FILE="$HOME/.config/hypr/envs.conf"
local AUTOSTART_FILE="$HOME/.config/hypr/autostart.conf"
local DOWNLOAD_URL="https://github.com/ful1e5/Bibata_Cursor/releases/download/v2.0.7/Bibata-Modern-Ice.tar.xz"
local ARCHIVE_NAME="Bibata-Modern-Ice.tar.xz"
# --- 1. Descarga e Instalación ---
# --- Paso 1 y 2: Descargar, Extraer e Instalar ---
log_info "Descargando e instalando el tema de cursor..."
local TEMP_DIR
TEMP_DIR=$(mktemp -d -p "/tmp" cursor_setup_XXXXXX)
trap 'rm -rf "${TEMP_DIR}"' EXIT # Limpieza automática al salir
if ! curl -sL "$DOWNLOAD_URL" -o "${TEMP_DIR}/${ARCHIVE_NAME}"; then
if curl -sL "$DOWNLOAD_URL" -o "${TEMP_DIR}/${ARCHIVE_NAME}"; then
tar -xJf "${TEMP_DIR}/${ARCHIVE_NAME}" -C "${TEMP_DIR}"
mkdir -p "$HOME/.icons"
# Asegurar una instalación limpia eliminando la versión anterior si existe
if [ -d "${TEMP_DIR}/${CURSOR_THEME}" ]; then
rm -rf "$HOME/.icons/${CURSOR_THEME}" # Eliminar destino para evitar conflictos
if mv "${TEMP_DIR}/${CURSOR_THEME}" "$HOME/.icons/"; then
log_success "Tema de cursor instalado en ~/.icons/"
else
log_error "No se pudo mover el tema del cursor a ~/.icons/"
return 1
fi
else
log_error "El directorio del tema '${CURSOR_THEME}' no se encontró en el archivo."
return 1
fi
else
log_error "No se pudo descargar el tema de cursor desde $DOWNLOAD_URL"
return 1
fi
tar -xJf "${TEMP_DIR}/${ARCHIVE_NAME}" -C "${TEMP_DIR}"
mkdir -p "$HOME/.icons"
# Asegura una instalación limpia eliminando la versión anterior si existe.
if [[ -d "${TEMP_DIR}/${CURSOR_THEME}" ]]; then
rm -rf "$HOME/.icons/${CURSOR_THEME}"
if ! mv "${TEMP_DIR}/${CURSOR_THEME}" "$HOME/.icons/"; then
log_error "No se pudo mover el tema del cursor a ~/.icons/"
return 1
# --- Paso 3: Configurar variables de entorno para Hyprland ---
if [ -f "$ENVS_FILE" ]; then
log_info "Configurando variables de entorno en $ENVS_FILE..."
if ! grep -q "HYPRCURSOR_THEME,${CURSOR_THEME}" "$ENVS_FILE"; then
echo -e "\n# Custom Cursor Theme" >> "$ENVS_FILE"
echo "env = HYPRCURSOR_THEME,$CURSOR_THEME" >> "$ENVS_FILE"
echo "env = HYPRCURSOR_SIZE,$CURSOR_SIZE" >> "$ENVS_FILE"
echo "env = XCURSOR_THEME,$CURSOR_THEME" >> "$ENVS_FILE"
echo "env = XCURSOR_SIZE,$CURSOR_SIZE" >> "$ENVS_FILE"
log_success "Variables de cursor añadidas a Hyprland."
else
log_info "Las variables de cursor para Hyprland ya parecen estar configuradas."
fi
log_success "Tema de cursor instalado en ~/.icons/"
else
log_error "El directorio del tema '${CURSOR_THEME}' no se encontró en el archivo descargado."
return 1
fi
# --- 2. Configuración para Hyprland ---
log_info "Configurando el cursor para Hyprland..."
mkdir -p "$HYPR_CONFIG_DIR"
touch "$ENVS_FILE"
# Elimina configuraciones de cursor anteriores para evitar duplicados.
sed -i '/^env = HYPRCURSOR_THEME/d' "$ENVS_FILE"
sed -i '/^env = HYPRCURSOR_SIZE/d' "$ENVS_FILE"
sed -i '/^env = XCURSOR_THEME/d' "$ENVS_FILE"
sed -i '/^env = XCURSOR_SIZE/d' "$ENVS_FILE"
# Añade las nuevas variables de entorno.
echo -e "\n# Configuración del Tema de Cursor (gestionado por Omarchy Setup)" >> "$ENVS_FILE"
echo "env = HYPRCURSOR_THEME,$CURSOR_THEME" >> "$ENVS_FILE"
echo "env = HYPRCURSOR_SIZE,$CURSOR_SIZE" >> "$ENVS_FILE"
echo "env = XCURSOR_THEME,$CURSOR_THEME" >> "$ENVS_FILE"
echo "env = XCURSOR_SIZE,$CURSOR_SIZE" >> "$ENVS_FILE"
log_success "Variables de entorno para el cursor añadidas a $ENVS_FILE."
# --- 3. Configuración para Aplicaciones GTK ---
# --- Paso 4: Configurar GTK ---
log_info "Configurando el cursor para aplicaciones GTK..."
if gsettings set org.gnome.desktop.interface cursor-theme "$CURSOR_THEME" && \
gsettings set org.gnome.desktop.interface cursor-size "$CURSOR_SIZE"; then
log_success "Configuración de GSettings para GTK aplicada correctamente."
else
log_error "No se pudo aplicar la configuración de GSettings para GTK."
return 1
fi
gsettings set org.gnome.desktop.interface cursor-theme "$CURSOR_THEME"
gsettings set org.gnome.desktop.interface cursor-size "$CURSOR_SIZE"
log_success "Configuración de GSettings aplicada."
log_success "La configuración del cursor ha finalizado."
log_warning "Para que todos los cambios surtan efecto, por favor, cierra sesión y vuelve a iniciarla."
log_success "¡Configuración del cursor completada!"
log_warning "Por favor, cierra sesión y vuelve a iniciarla para aplicar los cambios."
return 0
}
# Ejecutar si se llama directamente al script.
# Ejecutar si se llama directamente
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
install_mouse_cursor "$@"
fi
fi