Closed BeyondMagic closed 2 years ago
This should be a pretty simple add yep. If you wanna give a PR a shot I'll leave it to you. Let me know if you have any questions 😃.
I'm trying, catching up with reality and learning some Rust finally
A good place to start looking might be https://github.com/Toqozz/wired-notify/blob/8298b7281ea4f5e3a22853ce299e4d621caabaec/src/rendering/layout.rs#L77-L111
I forgot but there actually is an AppName
criteria already but it only checks if a name exists, which isn't very useful. We probably want to replace that with a string compare or something.
I'd dig this.
All right, I think I did it, but the notifications that are not rendered simply keep alive indefinitely (from the senders' side). I'll try to fix it before opening up a PR.
E: It's due to the Action
handlering.
My 5 cents. Inverting the dependency tree, so that apps can choose which layout to use, would be a more scalable solution IMHO. Specially since apps can change name between versions and it'd be out of our control.
Having to make changes to a layout configuration every time a new app comes along sounds like the wrong way to go about it.
True, but what do you mean by inverting the dependency tree?
E: And this version app-name-changing seems more like a problem with these apps themselves rather than the notification server, as far as I can see, it's like fixing a bug it's not meant for you to mess with.
So I've added some support for logical operators in render_criteria
and render_anti_criteria
now. Would you mind trying this out @BeyondMagic and letting me know if there are any issues/things missing?
I ended up going with what you said and just did it the simple way:
...
name: "root",
parent: "",
hook: Hook(parent_anchor: TL, self_anchor: TL),
offset: Vec2(x: 7.0, y: 7.0),
render_criteria: [And([AppName("Wired"), Body]), Or([AppName("Firefox"), AppName("Chromium")])],
//render_anti_criteria: [Or([AppName("Wired"), AppName("Hello"), AppName("jo")])],
...
The above will match and show a notification that has either:
I'll give a look next sunday, thanks for the hard work implementating it.
Working perfectly, thank you.
I think the title is pretty straightfoward, would make this 100x more customisable, being able to put some notifications in the center, others in the left top with different font sizes, etc.
I'll try to see how it works and see if I can actually make somewhat a prototype.