#!/usr/bin/env bash AGS_LOG_DIR="/tmp/omeron-ags-logs" module_description() { printf "AGS (Aylur's Gtk Shell) - Widget system for Hyprland\n" } module_required() { return 0; } 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" if command -v ags >/dev/null 2>&1; then tui_success "AGS already installed" return 0 fi if ! have paru; then tui_warn "paru not available. Install ags manually: paru -S aylurs-gtk-shell-git" return 0 fi tui_warn "AGS must be built from source (npm install + Go + meson)." tui_warn "This will first build 3 libastal libraries, then AGS itself." tui_warn "Total time can be 5-15 minutes depending on your system." printf '\n' if ! tui_confirm "Install AGS now?"; then tui_info "AGS installation skipped. Run later: paru -S aylurs-gtk-shell-git" return 0 fi if ! _ags_build_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" 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 }