pub struct NotificationServiceBuilder { /* private fields */ }Expand description
Builder for configuring and creating a NotificationService instance.
Allows customization of popup duration, do-not-disturb mode, and automatic removal of expired notifications.
Implementations§
Source§impl NotificationServiceBuilder
impl NotificationServiceBuilder
Sourcepub fn popup_duration(self, duration: u32) -> Self
pub fn popup_duration(self, duration: u32) -> Self
Sets the duration in milliseconds for how long popups should be displayed.
Sourcepub fn dnd(self, dnd: bool) -> Self
pub fn dnd(self, dnd: bool) -> Self
Configures the Do Not Disturb mode.
When enabled, new notifications won’t appear as popups but will still be added to the notification list.
Sourcepub fn remove_expired(self, remove: bool) -> Self
pub fn remove_expired(self, remove: bool) -> Self
Sets whether to automatically remove expired notifications.
Sourcepub fn blocklist(self, patterns: Property<Vec<String>>) -> Self
pub fn blocklist(self, patterns: Property<Vec<String>>) -> Self
Sets glob patterns for blocking notifications by app name.
Notifications from matching apps are silently dropped.
Patterns support * and ? wildcards.
Sourcepub fn with_daemon(self) -> Self
pub fn with_daemon(self) -> Self
Enables the Wayle D-Bus daemon for CLI control.
When enabled, the service registers at com.wayle.Notifications1,
allowing CLI tools to control notifications (dismiss, toggle DND, etc.).
Sourcepub async fn build(self) -> Result<Arc<NotificationService>, Error>
pub async fn build(self) -> Result<Arc<NotificationService>, Error>
Builds and initializes the NotificationService.
Establishes a D-Bus connection, registers the notification daemon, restores persisted notifications, and starts monitoring for events.
§Errors
Returns error if D-Bus connection fails, service registration fails, or monitoring cannot be started.