AppBadgeWatcher v2.1.1

A Hammerspoon Spoon that monitors app dock badges and displays notification counts in your menu bar.

Overview

Variables

AppBadgeWatcher.appsToWatch Variable #

List of application names (strings) to watch for dock badge counts.

AppBadgeWatcher.refreshInterval Variable #

Seconds between badge refresh polls (default: 15).

AppBadgeWatcher.nothingIndicator Variable #

Menu bar text shown when no badges are active (default: "・").

AppBadgeWatcher.grayscaleIcon Variable #

Convert app icons to grayscale in the menu bar (default: false).

AppBadgeWatcher.infiniteThreshold Variable #

Badge counts above this value are shown as a plus sign ("⁺") instead of the number (default: 9).

AppBadgeWatcher.snoozeOnClick Variable #

Clicking an app's menu bar item snoozes its current badge count (default: true).

Methods

AppBadgeWatcher:configure(opts) Method #

Set one or more of AppBadgeWatcher's spoon-level variables from a table. Call before :start().

  • opts - a table with any of appsToWatch, refreshInterval, nothingIndicator, grayscaleIcon, infiniteThreshold, snoozeOnClick
AppBadgeWatcher:init() Method #

Called automatically by hs.loadSpoon(). Logs the loaded version.

AppBadgeWatcher:start() Method #

Start the badge watcher: create the menu bar item and poll at the configured interval while any watched app is running.

AppBadgeWatcher:stop() Method #

Stop the badge watcher and remove the menu bar item.