Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
exclude_titles
config & CLI option for excluding window t…
…itles by regex (#99) * Add `exclude_titles` feature for enhanced window title exclusion This commit introduces the `--exclude-titles` argument to the aw-watcher-window module, allowing users to specify a list of window titles or regular expression patterns to exclude from tracking. This new feature is designed to complement the existing `--exclude-title` flag, providing enhanced flexibility for users who need to exclude multiple window titles without breaking compatibility with existing configurations. Key Changes: - Added the `--exclude-titles` argument to the argparse configuration in `config.py`, enabling the specification of multiple exclusion patterns. - Updated the `heartbeat_loop` function in `main.py` to support both `exclude_title` and `exclude_titles`, with `exclude_titles` allowing for an array of titles to be excluded. - Utilized the `re` module for regex pattern matching against window titles, ensuring case-insensitive comparisons. This enhancement ensures that users can now more precisely control which window titles are excluded from tracking, making the aw-watcher-window module more versatile and user-friendly. * Added exclude-titles in default config * Update aw_watcher_window/main.py Co-authored-by: Erik Bjäreholt <[email protected]> * Changed the helper message and changed how regex is compiled * Changed patterns to pass by parameter to heartbeat_loop * Change compile regex * Apply suggestions from code review --------- Co-authored-by: Erik Bjäreholt <[email protected]>
- Loading branch information