#!/usr/bin/env bash
set -Eeuo pipefail

while true; do
  echo "mail: $(notmuch count tag:unread AND \(NOT tag:ml OR thread:{tag:track}\))"
  if grep off-line <(acpi -a); then
    sleep $((60 * 15))
  else
    sleep $((60 * 1))
  fi
done
