Hi, everyone.
I released another GUI client for ActivityWatch.(yet-another-UI-for-AW)
It’s an experimental software and I implemented several ideas in it.
It provides some functions original AW client doesn’t have.
Can be categorized from the different viewpoints.For example,
- from the “work” viewpoint : “Documentation”,“Programing”,“Meeting”,etc.
- from the “project” viewpoint : “Project A”, “Project B”, etc.
Easy configuration
Key-word base categorization
Exact match for the window title
Unicode Normalization
Normalize keywords, by “NFC” and “NFD” to match both of “combined character sequence” and “precomposed character” of unicode strings. (I implemented it to avoid the problem described in this topics.)
Internationalization and some Japanese localization
If you are interested in it and want to try it, download from here.
Any comments or suggestions are greatly appreciated.
Now, “All-in-one installation package for Windows(64bit)” is available.
You can use the program easily without any preinstalled Python environment.
If you are Windows user and not familiar with Python, download from here and try it.
Notice: Module is quite huge (Almost 200Mbytes !), you may take long time to download.
Thank you for sharing this project. I particularly like the idea of categorizing the same activity from different perspectives, such as project, work type, or other user-defined categories.
The support for Japanese text and Unicode normalization is also a valuable addition. Window titles and application names can contain different Unicode representations even when the text appears identical to the user.
I looked at the categorization implementation and noticed a few areas where Unicode matching could potentially be made more reliable.
1. NFC and NFD alternatives do not cover all equivalent sequences
I noticed that the appendCCString function creates both NFC and NFD representations of a keyword and combines them as alternatives in a regular expression.
This is a useful approach for handling common differences between precomposed and decomposed characters.
However, it does not cover every canonically equivalent representation.
For example, consider the keyword:
éö
Its NFC representation contains two precomposed characters.
Its NFD representation contains two decomposed character sequences.
But an incoming window title might contain a mixture:
é followed by o plus COMBINING DIAERESIS.
This mixed representation is canonically equivalent to the original keyword, but it matches neither of the two complete alternatives.
A more general solution is to normalize both the configured keyword and the incoming window title to NFC before performing the comparison.
This avoids the need to enumerate different combinations of precomposed and decomposed characters.
2. Literal keywords should be escaped before becoming regular expressions
Another consideration is how category keywords are incorporated into the generated regular expressions.
If these are intended to be literal keywords, characters such as parentheses, periods, plus signs, and brackets should not automatically retain their special regex meanings.
For example:
notes (draft)
report.v2
C++
These strings can behave unexpectedly when inserted directly into regular-expression patterns.
Python’s re.escape can help preserve their literal meaning.
A simplified implementation could look like this:
import re
import unicodedata
def normalize_for_matching(text):
return unicodedata.normalize("NFC", text)
def create_keyword_pattern(keywords):
escaped = [
re.escape(normalize_for_matching(word))
for word in keywords
]
return re.compile("|".join(escaped))
keywords = [
"éö",
"notes (draft)",
"C++"
]
pattern = create_keyword_pattern(keywords)
titles = [
"é" + "o\u0308",
"Editing notes (draft)",
"Learning C++"
]
for title in titles:
normalized = normalize_for_matching(title)
print(bool(pattern.search(normalized)))
# True
# True
# True
Regex escaping preserves the literal meaning of user-defined keywords.
If the application intentionally supports user-authored regular expressions, those rules should ideally be distinguished from ordinary keyword rules.
3. Preserve original ActivityWatch event data
I would also recommend separating the original event text from its normalized comparison representation.
For example:
Original application name and window title
→ Preserve original values
→ Create normalized comparison values
→ Apply categorization rules
→ Store the category assignment
This avoids altering the activity history simply to make string matching more consistent.
It also makes the behavior easier to explain when users inspect individual events.
For multilingual applications, Unicode normalization, case folding, transliteration, and approximate string matching should be treated as separate operations.
They solve related but different problems.
A useful technical discussion of these distinctions is available here:
4. Mathematical Unicode characters provide interesting regression tests
Another category worth testing is Unicode compatibility characters.
Consider:
Project Alpha
𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐀𝐥𝐩𝐡𝐚
The second example uses mathematical bold Unicode characters.
These are different Unicode code points, not simply ordinary Latin text displayed with a different font.
NFC normalization does not convert those mathematical characters into ordinary Latin letters.
This raises an interesting design question for activity categorization.
Should compatibility-styled titles be categorized as equivalent to ordinary text?
For some workflows, that could be useful.
However, NFKC deliberately removes certain distinctions, so I would keep it optional rather than applying it to every event automatically.
For practical regression testing, a Unicode text generator can provide additional examples of mathematical alphabets, circled characters, decorative sequences, and combining marks:
For transparency, I contribute to both resources referenced above. I mention the generator only as an optional source of Unicode test strings, not as a required component of this project.
5. Approximate matching could be a future optional feature
The existing keyword categorization also suggests a possible extension.
For example:
Documentation - Project Alpha
Documentation - Project Alfa
These names are not canonically equivalent.
Unicode normalization cannot resolve the spelling difference.
However, a bounded Levenshtein-distance comparison could identify such variations as possible matches.
I would treat this as an optional fallback rather than part of the normal categorization pipeline.
A conservative matching order might be:
Exact matching after the selected normalization policy.
Literal keyword or explicitly configured regex matching.
Optional approximate matching for unmatched events.
Manual review when a result is ambiguous.
False-positive categorization matters in an activity tracker because it can distort project-time statistics.
Two similar project names may still represent completely different projects.
For that reason, edit distance should not be confused with Unicode equivalence.
6. Suggested regression tests
If this area is developed further, I would suggest including tests for:
Precomposed and decomposed accented characters.
Mixed NFC/NFD representations within a single title.
Japanese and multilingual application titles.
Literal keywords containing regex metacharacters.
Mathematical bold Unicode characters.
Fullwidth Latin characters.
Combining marks and multi-code-point emoji.
Positive and negative keyword rules.
Preserving original event titles.
Consistent categorization after saved rules are reloaded.
It might also be useful to cache normalized keywords and compiled regular expressions instead of reconstructing them repeatedly during event classification.
Final thoughts
I think the project’s combination of multiple categorization perspectives and Unicode-aware keyword matching is particularly valuable.
The existing NFC/NFD approach already addresses a real multilingual text-processing problem.
Normalizing both sides of comparisons, properly separating literal keywords from regex rules, and keeping compatibility normalization optional could make the categorization behavior more predictable.
These improvements would also preserve the original ActivityWatch event data while allowing more reliable matching across different Unicode representations.
Thank you again for sharing the project and making the implementation available. I hope these observations are helpful for future development.