Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions setup/lib/aur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# Callers must define the color vars: B S F O T R.

_aur_fresh=0
_aur_failed=()

# Local: install AUR pkg on the current system.
# Usage: _install_aur <pkg> <label> [<bin>]
# Pass <bin> to skip when the command already exists.
# Sets _aur_fresh=1 if newly installed, 0 if skipped.
# Sets _aur_fresh=1 if newly installed, 0 if skipped. On failure returns 1
# and appends <pkg> to _aur_failed.
_install_aur() {
local pkg="$1" label="$2" bin="${3:-}"
_aur_fresh=0
Expand All @@ -17,19 +19,36 @@ _install_aur() {
return 0
fi
echo -e " ${F}Installing ${label} (AUR)...${R}"
# One retry: when a dependency fails mid-build (e.g. a flaky download in
# its prepare()), yay rebuilds the dependency but has already given up
# on the package that needs it. A second pass finds the dep installed.
if ! _aur_build "$pkg"; then
echo -e " ${S}Retrying ${label}...${R}"
if ! _aur_build "$pkg"; then
echo -e " ${T}[!] ${label} install failed — retry later: yay -S ${pkg}${R}"
_aur_failed+=("$pkg")
return 1
fi
fi
echo -e " ${O}[✓] ${label} installed.${R}"
_aur_fresh=1
}

_aur_build() {
local pkg="$1"
if command -v yay &>/dev/null; then
yay -S --needed --noconfirm "$pkg"
elif command -v paru &>/dev/null; then
paru -S --needed --noconfirm "$pkg"
else
echo -e " ${S}Installing ${label} manually via makepkg...${R}"
local _tmpdir; _tmpdir=$(mktemp -d)
git clone "https://aur.archlinux.org/${pkg}.git" "$_tmpdir/$pkg"
(cd "$_tmpdir/$pkg" && makepkg -si --noconfirm)
echo -e " ${S}Installing ${pkg} manually via makepkg...${R}"
local _tmpdir _rc; _tmpdir=$(mktemp -d)
git clone "https://aur.archlinux.org/${pkg}.git" "$_tmpdir/$pkg" \
&& (cd "$_tmpdir/$pkg" && makepkg -si --noconfirm)
_rc=$?
rm -rf "$_tmpdir"
return $_rc
fi
echo -e " ${O}[✓] ${label} installed.${R}"
_aur_fresh=1
}

# Chroot variant: install AUR pkg into a target system mounted at $INSTALL_ROOT
Expand Down
40 changes: 23 additions & 17 deletions setup/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,51 +280,57 @@ if [ "$INSTALL_PKGS" = "y" ]; then
echo -e " ${O}[✓] Official packages installed.${R}"

# ── AUR packages (common pattern) ──
_install_aur brave-bin "Brave Browser" brave
_install_aur obsidian "Obsidian" obsidian
_install_aur satty "Satty" satty
_install_aur glslviewer "glslViewer (GPU shaders)" glslViewer
_install_aur eww "eww" eww
_install_aur brave-bin "Brave Browser" brave || true
_install_aur obsidian "Obsidian" obsidian || true
_install_aur satty "Satty" satty || true
_install_aur glslviewer "glslViewer (GPU shaders)" glslViewer || true
_install_aur eww "eww" eww || true
if [ "$WM_CHOICE" != "niri" ]; then
_install_aur hyprswitch "Hyprswitch (Alt+Tab)" hyprswitch
_install_aur hyprswitch "Hyprswitch (Alt+Tab)" hyprswitch || true
fi
_install_aur enpass-bin "Enpass" enpass
_install_aur yacreader "YACReader" YACReader
_install_aur onlyoffice-bin "OnlyOffice" desktopeditors
_install_aur betterbird-bin "Betterbird" betterbird
_install_aur libinput-gestures "libinput-gestures" libinput-gestures
_install_aur protonvpn-cli "ProtonVPN CLI" protonvpn-cli
_install_aur enpass-bin "Enpass" enpass || true
_install_aur yacreader "YACReader" YACReader || true
_install_aur onlyoffice-bin "OnlyOffice" desktopeditors || true
_install_aur betterbird-bin "Betterbird" betterbird || true
_install_aur libinput-gestures "libinput-gestures" libinput-gestures || true
_install_aur protonvpn-cli "ProtonVPN CLI" protonvpn-cli || true
if [ "$_aur_fresh" = 1 ]; then
echo -e " ${S} To login: protonvpn-cli login <username>${R}"
echo -e " ${S} Or use: Super+S → VPN${R}"
fi
_install_aur bauh "Bauh (package manager GUI)" bauh
_install_aur nwg-look "nwg-look (GTK theme editor)" nwg-look
_install_aur bauh "Bauh (package manager GUI)" bauh || true
_install_aur nwg-look "nwg-look (GTK theme editor)" nwg-look || true

# ── AUR packages with custom already-installed checks ──

# EB Garamond — font, no binary to probe
if ! fc-list | grep -qi "EB Garamond" 2>/dev/null; then
_install_aur otf-eb-garamond "EB Garamond font"
_install_aur otf-eb-garamond "EB Garamond font" || true
else
echo ""
echo -e " ${S}[~] EB Garamond already installed.${R}"
fi

# Colloid icons + cursors — identified by directory presence
if [ ! -d /usr/share/icons/Colloid-dark ] && [ ! -d "$HOME/.local/share/icons/Colloid-dark" ]; then
_install_aur colloid-icon-theme-git "Colloid icon theme"
_install_aur colloid-icon-theme-git "Colloid icon theme" || true
else
echo ""
echo -e " ${S}[~] Colloid icons already installed.${R}"
fi
if [ ! -d /usr/share/icons/Colloid-cursors ] && [ ! -d "$HOME/.local/share/icons/Colloid-cursors" ]; then
_install_aur colloid-cursors-git "Colloid cursors"
_install_aur colloid-cursors-git "Colloid cursors" || true
else
echo ""
echo -e " ${S}[~] Colloid cursors already installed.${R}"
fi

if [ ${#_aur_failed[@]} -gt 0 ]; then
echo ""
echo -e " ${T}[!] Some AUR packages failed: ${_aur_failed[*]}${R}"
echo -e " ${S} Retry later: yay -S ${_aur_failed[*]}${R}"
fi

# ── Div Acer Manager Max (DAMX) — only on Acer hardware ──
# DFM is installed by install.sh from the in-tree fork; no separate step needed here.
echo ""
Expand Down
Loading