For example, if I have a Programming
category and two children Emacs
and Vim
.
Emacs
has as children Java
and C++
and the same applies to Vim
.
Programming
could have a regex for filtering all events as it is a “root” category.
Then, the Emacs
category could have a regex to filter the events of the Programming
category to only take Emacs windows into account (regex: Emacs).
The same could be done for Vim
(regex: vim).
The events that are not taken by the Emacs
category nor the Vim
one stay as Programming
.
What this gives us is very precise statistics and near-zero conflict between children of different categories. For example in this case, if I edit a java file with emacs, it will go to:
Programming -> Emacs -> Java
If I edit a java file with vim, it will go to:
Programming -> Vim -> Java
no conflicts and it’s really easy!
If I edit a file using Sublime, it will go to:
Programming
If I edit a file using Emacs which is not java nor c++, it will just go to:
Programming -> Emacs
I think this is a way simpler solution than the current one. This could be optional to not trouble the people that don’t want this feature, but I think this could be a sane default for categories in ActivityWatch.
I hope this was clear enough to get the point across