Change title with reg exp

Create issue
Issue #47 new
Leonid Bond created an issue

Is it possible to change title? In arbtt-stats I receive following titles, but I want to use them as tag after changing a little:

Web:RescueTime___Time_management_software_for_staying_productive_and_happy_in_the_modern_workplace_-_Mozilla_Firefox | 1m00s | 1.79

How to change __ to _ and remove _-_Mozilla_Firefox in config file?

Comments (3)

  1. nomeata repo owner

    Something like this should work to get rid of the suffix:

    current window $title =~ /(.*) - Mozilla Firefox/   ==> tag Web:$1,
    

    There is no general support for search-and-replace in titles.

    I am also not sure if it is useful to use the window title directly as a tag – there will be many! It might be better to match certain titles and then give custom, targetted tags. Like

    current window $title =~ [ m!(?:~|home/jojo)/dokumente/Uni/DA!
                             , m!Diplomarbeit.pdf!
                             , m!LoopSubgroupPaper.pdf! ]
      ==> tag Project:DA,
    
  2. Leonid Bond reporter

    Thanks, removing suffix fine. Configuring each title as related to project tag removes the ability to get many things automatic. I will have many titles it total, but just a few for a project, when running stats for a specified time especialy, and firefox title explain what I do, search google for a specific problem, or testing a web project. Then I can remove a few lines not related to project, and have total stats. Since I'm working on web projects, all them can include google title, and and few other title sites related to web development. So, there are no better way for web browser. Only one thing, I guess just now, if Eclipse opened with specified project, but not active window...

    Thanks for the good software :)

  3. Log in to comment