fix: fallback to direct AUR install when paru fails, verify paru after build

This commit is contained in:
2026-05-28 23:43:35 +02:00
parent 3761dc707d
commit d6e94f5050
2 changed files with 88 additions and 89 deletions

View File

@@ -1,7 +1,5 @@
#!/usr/bin/env bash
AGS_LOG_DIR="/tmp/omeron-ags-logs"
module_description() {
printf "AGS (Aylur's Gtk Shell) - Widget system for Hyprland\n"
}
@@ -11,30 +9,6 @@ module_should_skip() {
command -v ags >/dev/null 2>&1
}
_ags_build_deps() {
local deps=("libastal-io-git" "libastal-git" "libastal-4-git")
local all_ok=0
mkdir -p "$AGS_LOG_DIR"
for dep in "${deps[@]}"; do
if is_package_installed "$dep"; then
tui_success "$dep already installed"
continue
fi
tui_info "Building $dep from AUR (dependency for AGS)..."
local log="$AGS_LOG_DIR/$dep.log"
if paru -S --needed --noconfirm "$dep" > "$log" 2>&1; then
tui_success "$dep built and installed"
else
tui_warn "$dep build failed — see $log"
all_ok=1
fi
done
return $all_ok
}
module_main() {
log_section "AGS Installation"
@@ -43,8 +17,8 @@ module_main() {
return 0
fi
if ! have paru; then
tui_warn "paru not available. Install ags manually: paru -S aylurs-gtk-shell-git"
if ! have git; then
tui_warn "git not available. Install ags manually after installing git."
return 0
fi
@@ -54,27 +28,19 @@ module_main() {
printf '\n'
if ! tui_confirm "Install AGS now?"; then
tui_info "AGS installation skipped. Run later: paru -S aylurs-gtk-shell-git"
tui_info "AGS installation skipped."
return 0
fi
if ! _ags_build_deps; then
local deps=("libastal-io-git" "libastal-git" "libastal-4-git")
if ! install_aur "${deps[@]}"; then
tui_warn "Some AGS dependencies failed to build."
tui_info "Check logs in $AGS_LOG_DIR/ for details."
if ! tui_confirm "Try to install AGS anyway?"; then
tui_info "AGS installation aborted. Fix deps manually, then run: paru -S aylurs-gtk-shell-git"
tui_info "AGS installation aborted."
return 0
fi
fi
tui_info "Building aylurs-gtk-shell-git from AUR..."
mkdir -p "$AGS_LOG_DIR"
local log="$AGS_LOG_DIR/aylurs-gtk-shell-git.log"
if paru -S --needed --noconfirm aylurs-gtk-shell-git > "$log" 2>&1; then
tui_success "AGS installed"
else
tui_warn "AGS build failed — see $log"
tui_info "Check the last 30 lines: tail -30 $log"
tui_info "Try manually: paru -S aylurs-gtk-shell-git"
fi
install_aur "aylurs-gtk-shell-git"
}