Crate libnotify

Source
Expand description

Rustic bindings to libnotify

extern crate libnotify;

fn main() {
    // Init libnotify
    libnotify::init("myapp").unwrap();
    // Create a new notification (doesn't show it yet)
    let n = libnotify::Notification::new("Summary",
                                         Some("Optional Body"),
                                         None);
    // Show the notification
    n.show().unwrap();
    // Update the existent notification
    n.update("I am another notification", None, None).unwrap();
    // Show the updated notification
    n.show().unwrap();
    // We are done, deinit
    libnotify::uninit();
}

Structs§

Notification
Notification represents a passive pop-up notification. It can contain summary text, body text, and an icon, as well as hints specifying how the notification should be presented. The notification is rendered by a notification daemon, and may present the notification in any number of ways. As such, there is a clear separation of content and presentation, and this API enforces that.

Enums§

Urgency
The urgency level of the notification.

Functions§

get_app_name
Gets the application name registered.
get_server_caps
Synchronously queries the server for its capabilities and returns them as a Vector.
get_server_info
Synchronously queries the server for its information, specifically, the name, vendor, server version, and the version of the notifications specification that it is compliant with.
init
Initialized libnotify. This must be called before any other functions.
is_initted
Gets whether or not libnotify is initialized.
set_app_name
Sets the application name.
uninit
Uninitialized libnotify.