mirror of
https://github.com/marcogll/omarchy_setup.git
synced 2026-01-13 13:25:16 +00:00
fix: resolve conflicts between modules and improve reliability
- Remove duplicate SSH_AUTH_SOCK configuration in apps.sh (now handled by gcr-ssh-agent) - Remove duplicate system update in apps.sh (now only in install_all) - Remove duplicate packages from zsh-config (git, zoxide, fastfetch, yt-dlp) - Add mg_dotfiles verification warning for Zsh/Hyprland modules - Make .zshrc backup non-critical to avoid interruption - Improve service verification with status checks before enabling - Add clarifying comments about cursor configuration layers
This commit is contained in:
@@ -197,11 +197,6 @@ run_module_main() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
# --- Instalación de Paquetes ---
|
# --- Instalación de Paquetes ---
|
||||||
log_info "Actualizando el sistema para evitar conflictos de dependencias..."
|
|
||||||
sudo pacman -Syu --noconfirm || {
|
|
||||||
log_warning "No se pudo completar la actualización del sistema. Pueden ocurrir errores de dependencias."
|
|
||||||
}
|
|
||||||
|
|
||||||
log_info "Instalando herramientas base..."
|
log_info "Instalando herramientas base..."
|
||||||
sudo pacman -S --noconfirm --needed "${PACMAN_BASE[@]}" || {
|
sudo pacman -S --noconfirm --needed "${PACMAN_BASE[@]}" || {
|
||||||
log_error "Error al instalar herramientas base"
|
log_error "Error al instalar herramientas base"
|
||||||
@@ -300,49 +295,43 @@ run_module_main() {
|
|||||||
# --- Configuración de Servicios ---
|
# --- Configuración de Servicios ---
|
||||||
log_info "Configurando servicios del sistema..."
|
log_info "Configurando servicios del sistema..."
|
||||||
|
|
||||||
# Configura GNOME Keyring para que actúe como agente de credenciales y SSH.
|
# Configura GNOME Keyring para que actúe como agente de credenciales.
|
||||||
log_info "Configurando GNOME Keyring como agente de credenciales..."
|
log_info "Configurando GNOME Keyring como agente de credenciales..."
|
||||||
mkdir -p "${HOME}/.config/environment.d"
|
|
||||||
cat <<'EOF' > "${HOME}/.config/environment.d/10-gnome-keyring.conf"
|
|
||||||
SSH_AUTH_SOCK=/run/user/$UID/keyring/ssh
|
|
||||||
EOF
|
|
||||||
# Habilita el servicio de GNOME Keyring para el usuario actual.
|
# Habilita el servicio de GNOME Keyring para el usuario actual.
|
||||||
if systemctl --user enable --now gnome-keyring-daemon.socket gnome-keyring-daemon.service >/dev/null 2>&1; then
|
if systemctl --user enable --now gnome-keyring-daemon.socket >/dev/null 2>&1; then
|
||||||
log_success "GNOME Keyring listo para gestionar contraseñas y claves SSH."
|
log_success "GNOME Keyring listo para gestionar contraseñas."
|
||||||
else
|
else
|
||||||
log_warning "No se pudo habilitar gnome-keyring-daemon en systemd de usuario. Verifica que tu sesión use systemd (--user)."
|
log_warning "No se pudo habilitar gnome-keyring-daemon en systemd de usuario. Verifica que tu sesión use systemd (--user)."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Inicia el daemon de GNOME Keyring en la sesión actual para que `ssh-add` funcione.
|
log_info "Las claves SSH se gestionarán con el módulo 'K' (gcr-ssh-agent)."
|
||||||
if command_exists gnome-keyring-daemon; then
|
|
||||||
local keyring_eval
|
|
||||||
keyring_eval="$(gnome-keyring-daemon --start --components=secrets,ssh 2>/dev/null)" || keyring_eval=""
|
|
||||||
if [[ -n "$keyring_eval" ]]; then
|
|
||||||
eval "$keyring_eval"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
local keyring_socket="/run/user/$UID/keyring/ssh"
|
|
||||||
if [[ -S "$keyring_socket" ]]; then
|
|
||||||
export SSH_AUTH_SOCK="$keyring_socket"
|
|
||||||
fi
|
|
||||||
log_info "Vuelve a iniciar sesión para que las variables de entorno del keyring se apliquen."
|
|
||||||
|
|
||||||
log_info "La sincronización de claves SSH se realizará por separado con el módulo 'K' después de reiniciar la sesión."
|
|
||||||
|
|
||||||
# Habilita los servicios de las aplicaciones instaladas.
|
# Habilita los servicios de las aplicaciones instaladas.
|
||||||
if command_exists keyd; then
|
if command_exists keyd; then
|
||||||
log_info "Habilitando servicio keyd..."
|
if systemctl is-enabled keyd.service &>/dev/null; then
|
||||||
sudo systemctl enable --now keyd.service 2>/dev/null || true
|
log_info "keyd.service ya está habilitado."
|
||||||
|
else
|
||||||
|
sudo systemctl enable --now keyd.service 2>/dev/null || true
|
||||||
|
log_success "keyd.service habilitado."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command_exists logiops; then
|
if command_exists logiops; then
|
||||||
log_info "Habilitando servicio logiops..."
|
if systemctl is-enabled logiops.service &>/dev/null; then
|
||||||
sudo systemctl enable --now logiops.service 2>/dev/null || true
|
log_info "logiops.service ya está habilitado."
|
||||||
|
else
|
||||||
|
sudo systemctl enable --now logiops.service 2>/dev/null || true
|
||||||
|
log_success "logiops.service habilitado."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command_exists teamviewer; then
|
if command_exists teamviewer; then
|
||||||
log_info "Habilitando servicio TeamViewer..."
|
if systemctl is-enabled teamviewerd.service &>/dev/null; then
|
||||||
sudo systemctl enable --now teamviewerd.service 2>/dev/null || true
|
log_info "teamviewerd.service ya está habilitado."
|
||||||
|
else
|
||||||
|
sudo systemctl enable --now teamviewerd.service 2>/dev/null || true
|
||||||
|
log_success "teamviewerd.service habilitado."
|
||||||
|
fi
|
||||||
if sudo teamviewer --daemon start >/dev/null 2>&1; then
|
if sudo teamviewer --daemon start >/dev/null 2>&1; then
|
||||||
log_success "TeamViewer daemon iniciado"
|
log_success "TeamViewer daemon iniciado"
|
||||||
else
|
else
|
||||||
@@ -352,10 +341,16 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if command_exists tlp; then
|
if command_exists tlp; then
|
||||||
log_info "Habilitando servicio TLP para gestión de energía..."
|
if systemctl is-enabled tlp.service &>/dev/null; then
|
||||||
sudo systemctl enable tlp.service 2>/dev/null || true
|
log_info "tlp.service ya está habilitado."
|
||||||
sudo systemctl start tlp.service 2>/dev/null || true
|
else
|
||||||
log_success "TLP habilitado e iniciado."
|
sudo systemctl enable tlp.service 2>/dev/null || true
|
||||||
|
log_success "tlp.service habilitado."
|
||||||
|
fi
|
||||||
|
if ! systemctl is-active tlp.service &>/dev/null; then
|
||||||
|
sudo systemctl start tlp.service 2>/dev/null || true
|
||||||
|
log_success "tlp.service iniciado."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_success "Aplicaciones instaladas correctamente"
|
log_success "Aplicaciones instaladas correctamente"
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ install_mouse_cursor() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# --- Paso 3: Configurar variables de entorno para Hyprland ---
|
# --- Paso 3: Configurar variables de entorno para Hyprland ---
|
||||||
|
# Nota: Esto configura el cursor para aplicaciones X11 y Hyprland.
|
||||||
|
# Para aplicaciones GTK/Flatpak, se usa gsettings en el Paso 4.
|
||||||
if [ -f "$ENVS_FILE" ]; then
|
if [ -f "$ENVS_FILE" ]; then
|
||||||
log_info "Configurando variables de entorno en $ENVS_FILE..."
|
log_info "Configurando variables de entorno en $ENVS_FILE..."
|
||||||
if ! grep -q "HYPRCURSOR_THEME,${CURSOR_THEME}" "$ENVS_FILE"; then
|
if ! grep -q "HYPRCURSOR_THEME,${CURSOR_THEME}" "$ENVS_FILE"; then
|
||||||
|
|||||||
@@ -41,14 +41,10 @@ install_zsh() {
|
|||||||
# --- 1. Instalar paquetes necesarios desde Pacman ---
|
# --- 1. Instalar paquetes necesarios desde Pacman ---
|
||||||
log_info "Instalando Zsh y herramientas esenciales..."
|
log_info "Instalando Zsh y herramientas esenciales..."
|
||||||
local pkgs=(
|
local pkgs=(
|
||||||
git
|
|
||||||
zsh
|
zsh
|
||||||
zsh-completions
|
zsh-completions
|
||||||
zsh-syntax-highlighting
|
zsh-syntax-highlighting
|
||||||
zsh-autosuggestions
|
zsh-autosuggestions
|
||||||
zoxide # Navegación inteligente
|
|
||||||
fastfetch # Información del sistema
|
|
||||||
yt-dlp # Descarga de videos/audio
|
|
||||||
unrar p7zip lsof # Dependencias para funciones en .zshrc
|
unrar p7zip lsof # Dependencias para funciones en .zshrc
|
||||||
)
|
)
|
||||||
for pkg in "${pkgs[@]}"; do
|
for pkg in "${pkgs[@]}"; do
|
||||||
@@ -156,7 +152,9 @@ install_zsh() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Crear copia de seguridad antes de proceder
|
# Crear copia de seguridad antes de proceder
|
||||||
backup_file "${target_home}/.zshrc" || return 1
|
if ! backup_file "${target_home}/.zshrc"; then
|
||||||
|
log_warning "No se pudo crear backup de .zshrc. Sobrescribiendo de todas formas."
|
||||||
|
fi
|
||||||
|
|
||||||
log_success "Enlazando .zshrc desde mg_dotfiles..."
|
log_success "Enlazando .zshrc desde mg_dotfiles..."
|
||||||
ln -sf "$repo_zshrc_path" "${target_home}/.zshrc"
|
ln -sf "$repo_zshrc_path" "${target_home}/.zshrc"
|
||||||
@@ -237,9 +235,9 @@ if [ -t 1 ]; then
|
|||||||
fi'
|
fi'
|
||||||
if [[ -f "${target_home}/.bashrc" ]] && ! grep -q "exec zsh" "${target_home}/.bashrc"; then
|
if [[ -f "${target_home}/.bashrc" ]] && ! grep -q "exec zsh" "${target_home}/.bashrc"; then
|
||||||
log_info "Configurando .bashrc para iniciar Zsh automáticamente..."
|
log_info "Configurando .bashrc para iniciar Zsh automáticamente..."
|
||||||
echo "$bashrc_zsh_loader" >> "${target_home}/.bashrc"
|
echo -e "\n# Launch Zsh (added by omarchy-setup)\n$bashrc_zsh_loader" >> "${target_home}/.bashrc"
|
||||||
else
|
else
|
||||||
log_info ".bashrc ya está configurado para lanzar Zsh."
|
log_info ".bashrc ya está configurado para lanzar Zsh o no existe."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# --- 7. Mensaje final ---
|
# --- 7. Mensaje final ---
|
||||||
|
|||||||
@@ -25,6 +25,14 @@ if [[ ! -d "${MODULES_DIR}" ]] || [[ ! -f "${MODULES_DIR}/common.sh" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Verificar mg_dotfiles si se va a usar Zsh o Hyprland
|
||||||
|
if [[ ! -d "${DOTFILES_DIR:-}" ]]; then
|
||||||
|
echo -e "\033[0;33m⚠ Advertencia: mg_dotfiles no encontrado en ${DOTFILES_DIR}\033[0m"
|
||||||
|
echo "Opciones 2 (Zsh) y H (Hyprland) requieren mg_dotfiles."
|
||||||
|
echo "Ejecuta: git clone https://github.com/marcogll/mg_dotfiles.git ${DOTFILES_DIR}"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
# Cargar funciones comunes
|
# Cargar funciones comunes
|
||||||
source "${MODULES_DIR}/common.sh"
|
source "${MODULES_DIR}/common.sh"
|
||||||
|
|
||||||
@@ -284,6 +292,12 @@ install_all() {
|
|||||||
|
|
||||||
local failed=()
|
local failed=()
|
||||||
|
|
||||||
|
# Actualizar el sistema antes de instalar todo
|
||||||
|
log_info "Actualizando el sistema antes de la instalación..."
|
||||||
|
if ! update_system; then
|
||||||
|
log_warning "La actualización del sistema falló. Continuando con la instalación..."
|
||||||
|
fi
|
||||||
|
|
||||||
for choice in "${INSTALL_ALL_CHOICES[@]}"; do
|
for choice in "${INSTALL_ALL_CHOICES[@]}"; do
|
||||||
IFS=';' read -r module_file _ description type <<< "${MODULES[$choice]}"
|
IFS=';' read -r module_file _ description type <<< "${MODULES[$choice]}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user