Skip to content

ActivityWatch: categorize applications for productivity scoring #220

@fiddur

Description

@fiddur

Summary

ActivityWatch data is currently stored without productivity scores or category labels (unlike RescueTime which assigns them server-side). This follow-up adds user-defined categorization rules so ActivityWatch data can be enriched with productivity scores on the way in.

Motivation

  • RescueTime assigns a -2 to +2 productivity score to each activity automatically
  • ActivityWatch has no such system — the backend receives only app names and window titles
  • Without scores, ActivityWatch data shows up in the productivity view but contributes nothing to productivity trend analysis
  • Users should be able to define which apps count as "productive" vs "distracting"

Proposed Design

Phase 1: Simple app-name rules (ship first)

User defines rules in Settings: app name pattern → category + score

emacs, vim, neovim          → "Software Development" / +2
alacritty, kitty, wezterm   → "Terminal" / +1
firefox, chromium           → "Browser" / 0  (neutral unless overridden)
slack, discord              → "Communication" / -1
youtube.com (title match)   → "Video" / -2

Rules are applied at push time (when the agent POSTs to /api/sync/activitywatch) and stored with each productivity record.

A separate "re-apply rules" sync operation can backfill existing records when rules change.

Phase 2: Regex/glob matching on app name or window title

For more precise control, support regex patterns on either app (always available) or title (window title from the AW event).

Phase 3: Sensible defaults

Ship a set of default rules covering common developer tools so new users get useful scores out of the box without having to configure anything.

Implementation Notes

  • Rules live in user settings (JSONB) as an array of { pattern, match_field, category, productivity } objects
  • Rule matching happens in activitywatch-sync.ts before calling insertProductivity
  • Rules should be defined in packages/api-spec as a schema
  • Settings page gets a new "ActivityWatch Rules" section (similar to Last.fm Tag Rules)
  • REST API: CRUD on /api/settings/activitywatch-rules
  • MCP: get_activitywatch_rules, add_activitywatch_rule, delete_activitywatch_rule

Related

Generated with Claude Code
via Happy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions