From 70d339140ba71cc411e1353eff24d8cf406fb1db Mon Sep 17 00:00:00 2001 From: rain Date: Wed, 26 Aug 2026 15:02:03 -0400 Subject: [PATCH] bootstrap: install maplemono-nf from AUR via paru, keep GitHub zip fallback --- run_once_20-install-user-packages.sh.tmpl | 49 ++++++++++++++--------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/run_once_20-install-user-packages.sh.tmpl b/run_once_20-install-user-packages.sh.tmpl index 6da568f..cab0f43 100755 --- a/run_once_20-install-user-packages.sh.tmpl +++ b/run_once_20-install-user-packages.sh.tmpl @@ -306,28 +306,37 @@ if fc-list : family 2>/dev/null | grep -qxF 'Maple Mono NF'; then log "Maple Mono NF already installed" else {{ if eq .os_family "arch" -}} - # Try paru first (clean install via AUR). If it fails (e.g. sudo TTY prompt - # in non-interactive runs, or AUR helper missing), fall back to downloading - # the upstream zip release directly — no sudo needed. - FONT_DIR="$USER_HOME/.local/share/fonts/maple-mono-nf" - mkdir -p "$FONT_DIR" - TMP_ZIP="$(mktemp /tmp/maple-font.XXXXXX.zip)" - if curl -fL --retry 3 \ - "https://github.com/subframe7536/Maple-font/releases/download/${MAPLE_FONT_VERSION}/MapleMono-NF.zip" \ - -o "$TMP_ZIP"; then - log "extracting font files" - unzip -q -o "$TMP_ZIP" -d "$FONT_DIR" - rm -f "$TMP_ZIP" - log "refreshing font cache (fc-cache)" - if command -v fc-cache >/dev/null 2>&1; then - fc-cache -fv >/dev/null - else - log "WARNING: fc-cache not found — install fontconfig package" + # Install from AUR via paru (maplemono-nf package; paru is set up by + # run_once_10-add-chaotic-aur). If paru is missing or the AUR install + # fails (e.g. sudo TTY prompt in non-interactive runs), fall back to + # downloading the upstream zip release directly — no sudo needed. + if command -v paru >/dev/null 2>&1 && paru -S --needed --noconfirm maplemono-nf; then + log "maplemono-nf installed via AUR (paru)" + if ! fc-list : family 2>/dev/null | grep -qxF 'Maple Mono NF'; then + log "WARNING: maplemono-nf installed but 'Maple Mono NF' family not found" fi else - log "WARNING: failed to download Maple Mono NF from GitHub" - log "manual install: https://github.com/subframe7536/Maple-font" - rm -f "$TMP_ZIP" + log "AUR install unavailable or failed — falling back to GitHub zip" + FONT_DIR="$USER_HOME/.local/share/fonts/maple-mono-nf" + mkdir -p "$FONT_DIR" + TMP_ZIP="$(mktemp /tmp/maple-font.XXXXXX.zip)" + if curl -fL --retry 3 \ + "https://github.com/subframe7536/Maple-font/releases/download/${MAPLE_FONT_VERSION}/MapleMono-NF.zip" \ + -o "$TMP_ZIP"; then + log "extracting font files" + unzip -q -o "$TMP_ZIP" -d "$FONT_DIR" + rm -f "$TMP_ZIP" + log "refreshing font cache (fc-cache)" + if command -v fc-cache >/dev/null 2>&1; then + fc-cache -fv >/dev/null + else + log "WARNING: fc-cache not found — install fontconfig package" + fi + else + log "WARNING: failed to download Maple Mono NF from GitHub" + log "manual install: https://github.com/subframe7536/Maple-font" + rm -f "$TMP_ZIP" + fi fi {{ else if eq .os_family "debian" -}} log "downloading MapleMono-NF.zip from subframe7536/Maple-font $MAPLE_FONT_VERSION"