Count cups of coffee (or anything) in your Mac menu bar

Two cups of coffee, five glasses of water, three stretch breaks. A ten-line command keeps a count for today in a file; a File meter shows it the moment it changes. Bind the command to a keyboard shortcut and counting takes one keystroke.

Recipe tested October 29, 2026 with Multimeter 1.1. Source: File.

Preview: the Tally Marks face and two alternatives, with sample values like the ones this recipe returns.

What you need

  • Multimeter for macOS 13 or later, $19.99 once.
  • Nothing to install.

Set it up

  1. Make the tally command. This writes it to ~/.local/bin and counts your first coffee:
    Terminal (once)
    mkdir -p ~/.local/bin && cat > ~/.local/bin/tally <<'EOF'
    #!/bin/zsh
    # tally coffee      add one to today's coffee count
    # tally coffee 0    set it to a number
    name=${1:-coffee}; f=~/.multimeter/$name.txt; today=$(date +%F)
    mkdir -p ~/.multimeter
    if [[ -n $2 ]]; then n=$2
    elif [[ -f $f && $(sed -n 2p $f) == $today ]]; then n=$(( $(head -1 $f) + 1 ))
    else n=1; fi
    printf '%s\n%s\n' $n $today > $f.tmp && mv $f.tmp $f
    echo $n
    EOF
    chmod +x ~/.local/bin/tally && ~/.local/bin/tally coffee
  2. Add a File meter and choose ~/.multimeter/coffee.txt (Shift-Command-Period shows dot folders in the file dialog). The first line of the file is today’s count.
  3. Set the range to 0 to your daily limit, with alerts on High values.
  4. Make counting quick: a Shortcuts action Run Shell Script with ~/.local/bin/tally coffee and a keyboard shortcut, or a Raycast script command.

Multimeter settings

In Customize This Meter… (from the meter’s menu):

Settings for this meter
SettingValue
SourceFile
File~/.multimeter/coffee.txt
Range0 to 5
AlertsHigh values: warning 3, critical 5
LabelCOFFEE
FaceTally Marks, Hearts or XP Bar

Tested: Run on October 29, 2026: three runs printed 1, 2 and 3, the file’s first line read 3, and tally coffee 0 reset it.

More on this source, including every format it reads, in the File guide.

Limits

  • The count resets with your first tally of a new day, so until then the meter still shows yesterday’s total.

Variations

Water, breaks, anything

Each name gets its own file: tally water writes ~/.multimeter/water.txt. Add one File meter per name.

Without a file

Send the number straight to a Sent Value meter instead: open -g "multimeter://set?key=coffee&value=$(tally coffee)".

Troubleshooting

What the meter says, why, and what to do
SymptomCauseFix
command not found: tally~/.local/bin isn’t on your Terminal’s PATH.Run it as ~/.local/bin/tally, or add the folder to PATH in ~/.zshrc.
The meter shows 2026A different file format put the date first.Use the command as written: count on the first line, date on the second.

Questions

Does this work in the Mac App Store version?

Yes. File meters and Sent Value meters work in every version; the tally command runs from Terminal, Shortcuts or Raycast, not from Multimeter.

Related

Put it in your menu bar

$19.99 one-time. No subscription. Needs macOS 13 Ventura or later.