Exclude overlapping tag

Create issue
Issue #37 resolved
Timothy created an issue

Hello, I have an overlapping tag problem, I want to have a misc category Web, and then categories like News, VCS_Web, subuser_web (my personal homepage). I'd like these categories to not be counted as web, but when I tried to define Web with something like && ! tag =~ News I didn't get anywhere.

So what I want to be able to do is to create a group of tags that take precidence over a more general pattern. For example, if I have:

current window $title =~ [/GitHub.*/,/.*Bitbucket -.*/] ==> tag VCS_Web,
current window $title =~ [/.*Zprávy Google.*/,/.*Google News.*/,/.*CNN.*/,/.*News.*/,/.*New York Times.*/,/.*Business Insider.*/] ==> tag News,

I want to be able to then create a patern that matches this:

current window $title =~ [/.*Chromium/,/.*Mozilla Firefox.*/] ==> tag Web,

but not any of the previous patterns defined.

Comments (7)

  1. nomeata repo owner

    The way to do that is to use the ; operator to combine rules instead of the , command. Interestingly, this is not documented at http://arbtt.nomeata.de/doc/users_guide/configuration.html#idp23119324! Anyways, you should be able to achieve what you want with (untested):

    { current window $title =~ [/GitHub.*/,/.*Bitbucket -.*/] ==> tag VCS_Web,
      current window $title =~ [/.*Zprávy Google.*/,/.*Google News.*/,/.*CNN.*/,/.*News.*/,/.*New York Times.*/,/.*Business Insider.*/] ==> tag News
    } ; current window $title =~ [/.*Chromium/,/.*Mozilla Firefox.*/] ==> tag Web
    
  2. Timothy reporter

    Thanks for the quick response. This gives me:

    Parser error: "/home/timothy/.arbtt/categorize.cfg" (line 5, column 3): unexpected ';' expecting "," or end of input

  3. nomeata repo owner

    Try putting the whole block into {} again. If there is a , before, it expects more commas. I guess that is a bit obscure…

  4. Timothy reporter

    Thanks, I have it working now.

    I'm re-reading the docs now, and I noticed:

    -- A rule that probably everybody wants. Being inactive for over a minute -- causes this sample to be ignored by default. $idle > 60 ==> tag inactive,

    There is a comma at the end of that line. Does that mean that this is wrong, that idle time isn't acutally ignored in the sample, just like the tags overlapped in my previous example?

  5. nomeata repo owner

    The inactive tag overlaps just like others, but arbtt-stats by default ignore them, unless you specify --also-inactive.

  6. Log in to comment