From 2f29cb8bae642bd5eebfefcd2d6c818c6cd6a40e Mon Sep 17 00:00:00 2001 From: Sir Blob Date: Sun, 20 Sep 2026 23:02:17 +0000 Subject: [PATCH] Install the maintained pywal fork and skip packages already present --- bin/blob-wallpaper-set | 5 +++++ docs/packages.md | 13 ++++++++++--- install/steps/packages.sh | 35 ++++++++++++++++++++++++++++++++--- packages/blob-aur.packages | 4 ++-- 4 files changed, 49 insertions(+), 8 deletions(-) diff --git a/bin/blob-wallpaper-set b/bin/blob-wallpaper-set index ce7cfa5..41305ba 100755 --- a/bin/blob-wallpaper-set +++ b/bin/blob-wallpaper-set @@ -37,6 +37,11 @@ else fi fi +if ! command -v wal >/dev/null 2>&1; then + echo "Error: 'wal' is not installed. Install it with: yay -S python-pywal16" + exit 1 +fi + echo "Extracting colors using Pywal..." wal -i "$IMAGE_PATH" -n -q 2> >(grep -v "deprecated in IMv7" >&2) diff --git a/docs/packages.md b/docs/packages.md index 5d9374b..c1a21d4 100644 --- a/docs/packages.md +++ b/docs/packages.md @@ -74,8 +74,15 @@ packages/blob-aur.packages 10 packages with no official equivalent ``` Only missing packages are touched, through `pacman -S --needed` and -`yay -S --needed`. `./install.sh --check` lists what it would install without -installing anything, and `--skip-packages` does the directories and config only. +`yay -S --needed`. An entry is treated as already installed, and skipped, when a +package of that name is installed, when an installed package provides that name, +or when the name is a group whose members are all installed - so `base-devel` and +packages pulled in under a different name no longer come back on every run. AUR +packages are built one at a time, so a build that fails is reported at the end +instead of stopping the install. + +`./install.sh --check` lists what it would install without installing anything, +and `--skip-packages` does the directories and config only. ### Validating the lists @@ -111,7 +118,7 @@ Omarchy's own package list, because they were installed by hand on this machine: | Package | Needed by | | --- | --- | -| `python-pywal` | `blob-wallpaper-set`, palette extraction | +| `python-pywal16` | `blob-wallpaper-set`, palette extraction | | `awww` | the wallpaper daemon `blob-wallpaper-set` and `blob-theme-menu` drive | | `playerctl` | the quick settings media row | diff --git a/install/steps/packages.sh b/install/steps/packages.sh index 221baa4..40a288b 100644 --- a/install/steps/packages.sh +++ b/install/steps/packages.sh @@ -3,6 +3,21 @@ read_package_list() { grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$1" } +package_installed() { + local name="$1" member + + pacman -Q "$name" &>/dev/null && return 0 + pacman -T "$name" &>/dev/null && return 0 + + local -a members=() + mapfile -t members < <(pacman -Sg "$name" 2>/dev/null | awk '{print $2}') + (( ${#members[@]} )) || return 1 + + for member in "${members[@]}"; do + pacman -Q "$member" &>/dev/null || return 1 + done +} + # A list entry may be "wanted|already-fine", which asks for the first name but # treats either as satisfying the requirement. That is how the AUR replacement # for a package still shipped by another repository avoids a file conflict. @@ -11,8 +26,8 @@ missing_packages() { for entry in $(read_package_list "$1"); do wanted=${entry%%|*} alternative=${entry#*|} - pacman -Q "$wanted" &>/dev/null && continue - [[ $alternative != "$entry" ]] && pacman -Q "$alternative" &>/dev/null && continue + package_installed "$wanted" && continue + [[ $alternative != "$entry" ]] && package_installed "$alternative" && continue printf '%s\n' "$wanted" done } @@ -52,10 +67,24 @@ install_packages() { return 0 } say "install ${#aur_missing[@]} AUR package(s)" - yay -S --needed --noconfirm "${aur_missing[@]}" + install_aur_packages "${aur_missing[@]}" fi } +install_aur_packages() { + local package + local -a failed=() + + for package in "$@"; do + yay -S --needed --noconfirm "$package" || failed+=("$package") + done + + (( ${#failed[@]} == 0 )) && return 0 + + say "WARN ${#failed[@]} AUR package(s) failed to build: ${failed[*]}" + say "WARN the install continued; retry them with 'yay -S '" +} + # A fresh Arch install has no AUR helper, and yay is not in the official # repositories, so it is built from the AUR once with makepkg. Everything after # this point can then use yay normally. diff --git a/packages/blob-aur.packages b/packages/blob-aur.packages index 0363a69..80aedab 100644 --- a/packages/blob-aur.packages +++ b/packages/blob-aur.packages @@ -3,8 +3,8 @@ # # These have no official-repo equivalent. See docs/packages.md. -# Palette extraction behind blob-wallpaper-set -python-pywal +# Palette extraction behind blob-wallpaper-set; pywal16 is the maintained fork +python-pywal16|python-pywal # Terminal dispatch; every TUI launcher's Exec= line calls it xdg-terminal-exec