Skip to content

Commit

Permalink
Add not include filter
Browse files Browse the repository at this point in the history
If the title filter starts with a !, then
every window that does not contain the title
match the filter
  • Loading branch information
p1gp1g authored and jmmaranan committed Oct 25, 2023
1 parent a00b0c9 commit a171493
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/extension/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -2457,7 +2457,16 @@ export class WindowManager extends GObject.Object {
matchTitle = kf.wmTitle === windowTitle;
} else {
let titles = kf.wmTitle.split(",");
matchTitle = titles.filter((t) => windowTitle && windowTitle.includes(t)).length > 0;
matchTitle = titles.filter((t) => {
if (windowTitle) {
if (t.startsWith('!')) {
return !windowTitle.includes(t.slice(1))
} else {
return windowTitle.includes(t)
}
}
return false
}).length > 0;
}
}
if (kf.wmClass) {
Expand Down

0 comments on commit a171493

Please sign in to comment.