Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add not_equals and not_regex match types #798

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

RiceaRaul
Copy link
Contributor

@RiceaRaul RiceaRaul commented Oct 18, 2024

To @rpop0 "complaints" I added not equals for matchtype.

  • Added a new match type: NotEquals, which checks for inequality.
  • Extended the Regex match type to support an optional not parameter for negating regex matches.

An example of use would be for steam, you want the friend list and the chat to be ignored.

  • window_title for friends list is Friends
  • window_title for a chat is the person's name.
    Normally you can use the regex method ^(?:(?!Steam).*$ but rust does not have support for Negative Lookahead.

Exemple of ussage:

  • Not Equals:
- window_process: { equals: "steamwebhelper" }
  window_title: { not_equals: "Steam" }

-Not Regex

- window_process: { equals: "steamwebhelper" }
  window_title: { regex: "Steam", not: true }

At the same time, it fixes #786.

- Added a new match type: NotEquals, which checks for inequality.
- Extended the Regex match type to support an optional `not` parameter for negating regex matches.
@lars-berger
Copy link
Member

Ay this is a great idea 🙌 Thanks for submitting a PR

Change back regex and add new not_regex match type.
@lars-berger lars-berger changed the title feat: add NotEquals match type and not parameter for regex feat: add not_equals and not_regex match types Oct 23, 2024
@lars-berger
Copy link
Member

Perfect thanks 👌 Will go ahead and merge

@lars-berger lars-berger merged commit 65d5d4e into glzr-io:main Oct 23, 2024
2 checks passed
Copy link

🎉 This PR is included in version 3.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[Bug] some window rules don't work
2 participants