#!/bin/sh
set -eu

while true; do
  printf "mail: %s/%s\n" "$(notmuch count 'tag:unread AND (NOT tag:ml OR thread:{tag:track})')" "$(notmuch count tag:inbox)"
  if acpi -a | grep -q off-line; then
    sleep $((60 * 15))
  else
    sleep $((60 * 1))
  fi
done
