You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Different interpretation of regex in the Activity and Timeline sections #939
ActivityWatch version: v0.13.2
Modules: aw-server,aw-watcher-window,aw-watcher-afk
OS: Windows 10
I need to split an activity between clients. To do this, I use a category with the regex app_name.*unic_word_for_app_from_title.*. This works for the timeline, but not for the activity.
Example:
Name: TG
Parent: AKARN
App: telegram.exe
Words: AKARN,Elena V
Regex: telegram.exe.*(AKARN|Elena V).*
Case insensitive: True
Color: green
Name: TG
Parent: ACG
App: telegram.exe
Words: ACG,Admin V
Regex: telegram.exe.*(ACG|Admin V).*
Case insensitive: True
Color: dark cyan
Thanks for the report — I reproduced this with a fixture (two telegram events that differ only in title, plus your two TG rules).
The two views do not run the same matcher. It is not merge-order.
Timeline colors via app + '\n' + title (getCategorizationStringFromEvent → matchString, flags im). . does not match the newline.
Activity runs categorize() on unmerged window events, then displays merged-by-$category. The server tests each field separately (app, then title, …). No field contains both telegram.exe and AKARN, so the combined regex misses.
For telegram.exe.*(AKARN|Elena V).* / telegram.exe.*(ACG|Admin V).*, both paths miss. Timeline still looks split because unmatched events fall through to a per-window fallback color. Activity buckets every miss as Uncategorized, so Top Categories is one lump.
Workaround that agrees on both views: make the rule title-only, e.g. (AKARN|Elena V) and (ACG|Admin V). Caveat: that also matches those words in any other app (there is no AND across fields today).
A real combined-app+title matcher would need Activity to use the same join Timeline already documents, plus something that can cross that join ([\s\S] / (?s) — . will not). I am not opening a PR for that while aw-webui's review queue is already full; tracking it on our side as idea 1163.
TG + user is just a simple example, and yes I can unify the title for TG, but for mstsc and winbox it is not possible, because both use FQDN or IP in the title.
You don't need to rewrite those titles. For mstsc/winbox the FQDN or IP already in the title is the unique token — a title-only rule (office\.example.com or 10\.0\.0\.5, no mstsc.exe.* prefix) is what both views can match today.
Combined mstsc.exe.*host still matches nothing on either path: Activity tests app and title separately, so no field contains both.
If mstsc and winbox show the same host string and you need them in different categories, that is field-AND (app AND title). That does not exist yet. If their title formats already differ, match the distinctive title text.
Leaving this open for a joined app+title matcher; not opening that PR while the review queue is full.
Activity
TimeToBuildBob commentedon Aug 28, 2026
Thanks for the report — I reproduced this with a fixture (two telegram events that differ only in title, plus your two
TGrules).The two views do not run the same matcher. It is not merge-order.
app + '\n' + title(getCategorizationStringFromEvent→matchString, flagsim)..does not match the newline.categorize()on unmerged window events, then displays merged-by-$category. The server tests each field separately (app, thentitle, …). No field contains bothtelegram.exeandAKARN, so the combined regex misses.For
telegram.exe.*(AKARN|Elena V).*/telegram.exe.*(ACG|Admin V).*, both paths miss. Timeline still looks split because unmatched events fall through to a per-window fallback color. Activity buckets every miss as Uncategorized, so Top Categories is one lump.Workaround that agrees on both views: make the rule title-only, e.g.
(AKARN|Elena V)and(ACG|Admin V). Caveat: that also matches those words in any other app (there is no AND across fields today).A real combined-app+title matcher would need Activity to use the same join Timeline already documents, plus something that can cross that join (
[\s\S]/(?s)—.will not). I am not opening a PR for that while aw-webui's review queue is already full; tracking it on our side as idea 1163.Fixture write-up: https://github.com/ErikBjare/bob/blob/master/knowledge/research/2026-08-28-aw-webui-939-activity-timeline-category-split.md
arshanskiyav commentedon Aug 30, 2026
Thank you for your reply.
TG + user is just a simple example, and yes I can unify the title for TG, but for
mstscandwinboxit is not possible, because both use FQDN or IP in the title.I'll keep an eye on it, thanks
TimeToBuildBob commentedon Aug 30, 2026
You don't need to rewrite those titles. For mstsc/winbox the FQDN or IP already in the title is the unique token — a title-only rule (
office\.example.comor10\.0\.0\.5, nomstsc.exe.*prefix) is what both views can match today.Combined
mstsc.exe.*hoststill matches nothing on either path: Activity testsappandtitleseparately, so no field contains both.If mstsc and winbox show the same host string and you need them in different categories, that is field-AND (app AND title). That does not exist yet. If their title formats already differ, match the distinctive title text.
Leaving this open for a joined app+title matcher; not opening that PR while the review queue is full.