diff --git a/.config/yadm/bootstrap.d/check-installed-tools b/.config/yadm/bootstrap.d/check-installed-tools new file mode 100755 index 0000000..ebfa8da --- /dev/null +++ b/.config/yadm/bootstrap.d/check-installed-tools @@ -0,0 +1,18 @@ +#!/bin/bash + +declare -A TOOLS +TOOLS+=( ["batcat"]=bat ["exa"]=exa ["fdfind"]=fd-find ["glow"]=glow ["readelf"]=binutils ["rg"]=ripgrep ["thefuck"]=thefuck ) + +declare -A PACKAGES + +for tool in ${!TOOLS[@]}; do + if [[ ! -x "$(command -v $tool)" ]]; then + PACKAGES+=("${TOOLS[$tool]}") + fi +done + +if [[ ${#PACKAGES[@]} > 0 ]]; then + echo sudo apt install $(printf " %s" "${!PACKAGES[@]}") +else + echo All needed tools already installed. +fi