Clear all notifications on statusbar except for certain apps

Post your questions and help other users.

Moderator: Martin

Post Reply
teiji
Posts: 14
Joined: 25 Nov 2018 19:37

Clear all notifications on statusbar except for certain apps

Post by teiji » 09 Dec 2018 18:34

Hello, I'm trying to make a flow that activate at night every day to clear all notifications on statusbar, EXCEPT for "System UI" and "Textra" (my messaging app). I tried the action "Remove notification on statusbar" and used some regex on content title, but this either doesn't remove any notification or remove all notifications (I think either my regex is wrong or it shouldn't be done on content title.)

Does anyone know how to clear all notifications, except for "System UI" and "Textra"?
Last edited by teiji on 10 Dec 2018 17:30, edited 1 time in total.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Clear all notifications on statusbar except for certain

Post by Desmanto » 10 Dec 2018 17:10

Thanks to your question, I finally understand what's wrong with my regex in GCam flow.

The correct regex using "matches regex" should be

Code: Select all

\n(?!System UI|Textra).*\n
I put \n there because I test it at my phone, create the notification using automagic. And the notification text contain 1 line break before and after.

This regex will allow any text to trigger the flow. But if the text contain "System UI" or "Textra", it won't.

I think the better way to do it is to filter packagename, check all and then uncheck System UI and Textra. Leave the Text contains text and blank. This will catch all notifications from all apps except System UI and Textra. The downside is, if you install new apps, you have to add them again into this list, once in a while.

This probably brings us to the feature request to allow negation package name filter (current one doesn't have negation feature). Which mean we choose System UI and Textra, tick checkbox negate (requested feature), and any app except these 2 will trigger the flow.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

teiji
Posts: 14
Joined: 25 Nov 2018 19:37

Re: Clear all notifications on statusbar except for certain

Post by teiji » 10 Dec 2018 18:02

I just tried your regex with content title/text and neither work correctly. You are right about filtering with packagename, but I don't see that anywhere in "remove notification on statusbar." I can only select content title, content big title, text, and big text. Can we use regex on the package names field to filter packages?

Can you show me a screenshot of how to filter by packagename? Or did you mean it's not in the app yet but is feature request?

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Clear all notifications on statusbar except for certain

Post by anuraag » 11 Dec 2018 00:31

Desmanto wrote:I think the better way to do it is to filter packagename, check all and then uncheck System UI and Textra. Leave the Text contains text and blank. This will catch all notifications from all apps except System UI and Textra. The downside is, if you install new apps, you have to add them again into this list, once in a while.
packageName field supports glob pattern. Maybe that can be use to exclude packageName?

teiji
Posts: 14
Joined: 25 Nov 2018 19:37

Re: Clear all notifications on statusbar except for certain

Post by teiji » 11 Dec 2018 01:27

I figured it out. I was overcomplicating it. All I had to do was click the "Select all" checkbox when selecting the package names, and then unselect whatever I want to keep (System UI, Textra). And then glob filter content/title with "*".

Edit: I finally understood what you meant Desmanto lol.
I think the better way to do it is to filter packagename, check all and then uncheck System UI and Textra. Leave the Text contains text and blank. This will catch all notifications from all apps except System UI and Textra. The downside is, if you install new apps, you have to add them again into this list, once in a while.
Thanks for the help.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Clear all notifications on statusbar except for certain

Post by Desmanto » 11 Dec 2018 05:40

Hehehe, sorry for confusing wording. But as you can see, it will better if we only need to choose "System UI" and "Textra" and have extra option "negation", so only these 2 apps are excluded. I remember I have requested it somewhere, but can't find my post now :lol:

You can use match glob with *, or simply contains Text and don't put anything (it will match everything).
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply