Open pas-calc opened 3 years ago
The behavior your describe is expected, so I am not sure what this issue is about. Do you want confirmation that this is indendet behaviour, suggest better documentation, or do you suggest that the behaviour changes?
suggest better documentation
This, because it was not clear for me, so I tried it out and the example above is proof of concept. Maybe just add this to the docs that the first match per category is the one that is used. (so put general rules after specific ones whereby the last rules are for thos that were not detected before)
A useful example (at least for me to detect whether I use E-Mail actively or just in the background), the order matters
current window $title =~ [/.*Thunderbird.*/, /.*Outlook.*/, /.*GMX.*/, /.*Webmail.*/] ==> tag Mail:aktiv,
any window $title =~ [/.*Thunderbird.*/, /.*Outlook.*/, /.*GMX.*/, /.*Webmail.*/] ==> tag Mail:inaktiv,
Then analyze using
arbtt-stats -c "Mail" --for-each=day -m0
Is there the possibility to define a variable for pattern matching?
In the docs there is written
However it is important that these sum up to 100% , and the question occurs how does this work precisely? The answer is that the first rule that applies , then stops (acutally it does not stop evaluating, since other Category could be assigned later, but not to the same category, it is not overwritten, but the other way round! - first match applies)
Working example: version1:
version2: (the two lines interchanged)
Running
arbtt-stats
in each case , one obtains: ad1) no radio (because I only listened to radio via webradio using browser) ad2) radio, and browsing (which is not radio) , this is of course in realworld application the preferred solution, always set this browser related line lastsee also: related issue on bitbucket user guide docs