#!/usr/bin/env bash

# omarchy:summary=Install the CLI tool belt: bats, calc, glances, lnav, nmap, pandoc, pdftk, qemu, shellcheck, shfmt, tree, vips, xorriso and TeX
# omarchy:requires-sudo=true

# Based: Debian's packages and their brew names. dig, host, nslookup, route
# and killall ship with macOS, and apt-file, aptitude and yad have no Mac
# counterpart. qrterminal has no package on either OS, so Go builds it into
# ~/.local/bin.

set -eo pipefail

echo "Installing the CLI tool belt..."
omarchy-pkg-add apt-file linux=only aptitude linux=only bats brew=bats-core calc dnsutils linux=only glances \
  bind9-host linux=only jp2a psmisc linux=only lnav meson ninja-build brew=ninja nmap pandoc pdftk-java \
  qemu-system-x86 brew=qemu qrencode s3cmd shellcheck shfmt timg tree libvips-tools brew=vips libvips-dev linux=only \
  net-tools linux=only texlive-xetex brew=texlive texlive-latex-base linux=only texlive-latex-extra linux=only \
  texlive-fonts-recommended linux=only xorriso yad linux=only golang-go brew=go

if omarchy-cmd-missing qrterminal && [[ ! -x ~/.local/bin/qrterminal ]]; then
  echo "Building qrterminal..."
  mkdir -p ~/.local/bin
  GOBIN="$HOME/.local/bin" go install github.com/mdp/qrterminal/v3/cmd/qrterminal@latest
fi
