Page 1 of 1

Clear all notifications on statusbar except for certain apps

Posted: 09 Dec 2018 18:34
by teiji
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"?

Re: Clear all notifications on statusbar except for certain

Posted: 10 Dec 2018 17:10
by Desmanto
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.

Re: Clear all notifications on statusbar except for certain

Posted: 10 Dec 2018 18:02
by teiji
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?

Re: Clear all notifications on statusbar except for certain

Posted: 11 Dec 2018 00:31
by anuraag
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?

Re: Clear all notifications on statusbar except for certain

Posted: 11 Dec 2018 01:27
by teiji
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.

Re: Clear all notifications on statusbar except for certain

Posted: 11 Dec 2018 05:40
by Desmanto
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).