Skip to main content

Module vault

Module vault 

Source
Expand description

vault contains the necessary utilities/APTs for various common tasks required when creating a custom shell. This includes apps, pipewire, PAM, Mpris etc among other things.

For now, this module doesn't contain much utilities. As, more common methods are added, docs will expand to include examples and panic cases.

Current it provides three main functionalities, namely notification management interface via NotificationManager

Re-exports§

pub use mpris;

Structs§

AppData
Stores the relevent data for an application. Used internally by AppSelector.
AppSelector
AppSelector stores the data for each application with possible actions. Known bugs include failing to open flatpak apps in certain cases and failing to find icons of apps in certain cases both of which will be fixed in coming releases.
BlockingNotification
Holds blocking methods to notify when a notification has bee closed.
Notification
Object representing a notification.

Enums§

CloseReason
Reason to close a notification in NOTIFICATION_EVENT.
Hint
Hints provided by a notification. Refer here for more details. Currently “image-data” and “image_data” hints are not supported.
NotiError
Error type used by NotificationManager.
Timeout
Timeout duration for a notification.
Urgency
The proposed urgency level by the notification, implementations of trait NotificationManager can mark the accent color of their notifications based on this.

Statics§

NOTIFICATION_EVENT
This public static is only set when a notification server instance is passed in cast_spell. It is created to maintain the compliance with freedesktop’s desktop notification specification. It’s method can be called in specific senarios to notify applications that a notification with an id has been closed. This static holds an instance of BlockingNotificaiton

Traits§

NotificationManager
This trait’s implementation is necessary for passing spell’s generated widget into the notification field of cast_spell macro. It is important to note that implementation of this trait is not on the spell generated widget/window but on the slint generated window. For example, a window with name TopBar will have a spell implemetation TopBarSpell. This trait will be implemented over TopBar.

Functions§

fuzzy_search_best_n
This function is similar to fuzzy_search_sorted but keeps only the n best items, those with a better match.
set_notification
It is an internal function used in the expansion of cast_spell macro if the macro has a notification instance to run.