#!/bin/sh

bold="\\033[01;39m"
white="\\033[0m"

ltodo() {
  if command -v task >/dev/null 2>&1; then
    tc=$(task +PENDING count)
    if [ "${tc}" -gt "0" ]; then
      printf "[${bold}TODO: %s%s]" "${tc}" "${white}"
    fi
  fi
  if [ -f .todo ]; then
    items=$(todo | wc -l | awk '{print $1}')
    if [ "${items}" != "0" ]; then
      printf "\\n↪[${bold}TODO: %s%s]" "${items}" "${white}"
    fi
  fi
}
