Install the maintained pywal fork and skip packages already present

This commit is contained in:
2026-09-20 23:02:17 +00:00
parent 52e747fe3e
commit 2f29cb8bae
4 changed files with 49 additions and 8 deletions
+5
View File
@@ -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)
+10 -3
View File
@@ -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 |
+32 -3
View File
@@ -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 <name>'"
}
# 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.
+2 -2
View File
@@ -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