xmonad-config/install_deps

39 lines
986 B
Bash
Executable File

#!/bin/bash
## Install all pkgs required for xmonad to run at full capacity
# these are extra packages that pertain to processes outside xmonad but are
# still required/desired to make it work correctly
xmonad_pkgs=(autorandr picom)
query='.[].success |
objects |
.root.tree |
..|.left?.data, ..|.right?.data, .data? |
select(. != null) |
.fulfillment |
select(. != null) |
add | select(. != null)'
raw=$(xmonad --deps | jq "$query")
jq_type () {
echo "$1" | jq --raw-output "select(.type==\"$2\") | .name" | sort | uniq
}
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[@]}"; then
echo "At least one local package doesn't exist."
exit 1
fi
sudo pacman --noconfirm -S "${xmonad_pkgs[@]}" "${official[@]}"
yay --needed --noconfirm --norebuild --removemake -S "${local[@]}"