Skip to content

app: add native macOS dock badge showing unread count#137

Open
klement wants to merge 1 commit intoakissinger:masterfrom
klement:macos-dock-badge
Open

app: add native macOS dock badge showing unread count#137
klement wants to merge 1 commit intoakissinger:masterfrom
klement:macos-dock-badge

Conversation

@klement
Copy link
Copy Markdown
Contributor

@klement klement commented Apr 10, 2026

Summary

Adds a macOS dock badge that displays the number of threads matching a configurable notmuch query (defaults to tag:unread AND tag:inbox). The badge updates automatically after each mail sync.

Uses the native NSApp.dockTile API via pyobjc-framework-Cocoa (added as a platform-specific dependency on macOS). On non-macOS platforms the feature is a no-op.

Configuration via config.py:

# Change the query used for the badge count:
dodo.settings.macos_dock_badge_query = 'tag:unread AND tag:inbox'

# Disable the badge entirely:
dodo.settings.macos_dock_badge_query = ''

Test plan

  • On macOS with pyobjc-framework-Cocoa installed, verify badge appears on the dock icon with the unread count
  • Sync mail and verify the badge updates
  • Set dodo.settings.macos_dock_badge_query = '' and verify no badge is shown
  • On Linux, verify no errors and no dock badge code is invoked

Show the number of unread threads as a badge on the macOS dock icon
using pyobjc. The badge query is configurable via the new
macos_dock_badge_query setting (defaults to 'tag:unread AND tag:inbox').
The badge updates on startup, after mail sync, and after tag changes.

pyobjc-framework-Cocoa is now auto-installed on macOS via an
environment marker in setup.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant