2022-07-31 23:30:21 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Print list of packages to be installed via pacman
|
|
|
|
|
|
|
|
query='.[].success |
|
|
|
|
objects |
|
|
|
|
.root.tree |
|
|
|
|
..|.left?.data, ..|.right?.data, .data? |
|
|
|
|
select(. != null) |
|
|
|
|
.fulfillment |
|
|
|
|
select(. != null) |
|
|
|
|
add | select(. != null)'
|
|
|
|
|
|
|
|
jq_type () {
|
|
|
|
echo "$1" | jq --raw-output "select(.type==\"$2\") | .name" | sort | uniq
|
|
|
|
}
|
|
|
|
|
2022-08-01 16:26:00 -04:00
|
|
|
raw=$(echo -e "$(xmonad --deps | jq "$query")\n$(xmobar --deps | jq "$query")")
|
2022-07-31 23:30:21 -04:00
|
|
|
|
|
|
|
# these are extra packages that pertain to processes outside xmonad but are
|
|
|
|
# still required/desired to make it work correctly
|
2022-08-02 17:15:52 -04:00
|
|
|
xmonad_pkgs=(xorg-xinit xorg-server autorandr picom)
|
2022-07-31 23:30:21 -04:00
|
|
|
|
|
|
|
mapfile -t official < <(jq_type "$raw" "Official")
|
|
|
|
mapfile -t local < <(jq_type "$raw" "AUR")
|
|
|
|
|
|
|
|
if ! pacman -Si "${official[@]}" > /dev/null; then
|
|
|
|
echo "At least one official package doesn't exist."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! yay -Si "${local[@]}" > /dev/null; then
|
|
|
|
echo "At least one local package doesn't exist."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "${xmonad_pkgs[@]}" "${official[@]}" "${local[@]}" | tr ' ' '\n'
|