Skip to content

Conversation

@arebaka
Copy link

@arebaka arebaka commented May 31, 2025

This pull request introduces a new “overrides” mechanism in Mako’s INI-style configuration. Users can now specify one or more override.* keys inside a criteria block to defer certain property assignments until after all matching criteria have been evaluated.

Closes #566
Ref #559
Ref #211
CC: @arebaka

Copy link
Contributor

@ThinkChaos ThinkChaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, reviewing as a random mako user that's interested in such a feature, as per opening #559 a while back :)

I tried it out and unfortunately I don't think it can close #566 as is:

  • applying an override doesn't cause criteria defined later in the config that now match to apply. See this comment for an example config and the following comments for details on expectations.
    This seems like the biggest issue for me cause overriding the urgency doesen't cause the notification's color to match the override, but instead use the original urgency's color, thus not solving my personal use case.
  • that issue also mentions supporting criteria like timeout>1000. I think that could be a separate issue cause it seems like a bunch of work, but as it is, #566 is not fully resolved.

style->touch_binding.action = MAKO_BINDING_DISMISS;

// Everything in the default config is explicitly specified.
// Everything in the default config is explicitly specified ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: grammar/style

Suggested change
// Everything in the default config is explicitly specified ...
// Everything in the default config is explicitly specified...

#include <pango/pango.h>
#include "types.h"


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: style

Suggested change

Comment on lines +7 to +12
void init_default_style(struct mako_style *style);
void init_empty_style(struct mako_style *style);
void finish_style(struct mako_style *style);
bool apply_style(struct mako_notification *notif, const struct mako_style *style);
bool apply_superset_style(
struct mako_style *target, struct mako_config *config);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you create a new header for these, you should also move the implementation to style.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generalized defaults/overrides for notification properties

2 participants