Commit 76c85c6
feat: add
* 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]>exclude_titles config & CLI option for excluding window titles by regex (#99)1 parent 12c7bea commit 76c85c6
2 files changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
| |||
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
| 103 | + | |
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
98 | | - | |
| 107 | + | |
99 | 108 | | |
100 | 109 | | |
101 | 110 | | |
| |||
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
131 | 144 | | |
132 | 145 | | |
133 | 146 | | |
| |||
0 commit comments